Showing posts with label Solved. Show all posts
Showing posts with label Solved. Show all posts

Tuesday, 5 July 2011

Error when upgrading sandbox solution

The URL '_catalogs/solutions/mysolutions.wsp' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file of folder that is not in the current Web.

I encountered this error when trying to upgrade a sandbox solution in Sharepoint 2010.

Solved:
The problem was due to a feature template xml having a wrong namespace given to the assembly name for the feature receiver attributes. I corrected the namespace problem and the upgrade started working fine.
The corrected section of the feature.template.xml goes like this.
<UpgradeActions ReceiverAssembly="HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b2135059549c7590"
ReceiverClass="HelloWorld.Features.HelloWorldFeature.HelloWorldFeatureEventReceiver">

Friday, 24 June 2011

Error @ SPSite site = new SPSite()

I created a new console application using Visual Studio2010. The console application had only one single line of code.

using(SPSite site = new SPSite("http://myspsite2010"))
{
Console.Write(site.RootWeb.Title);
}


The error message I got when I debugged this simple console application is.

The Web application at 'http://myspsite2010' could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

Solved:
Right-click on the project > Go to properties. In the properties dialog go to 'Build'. Under the 'General' section change the 'Platform target' to 'x64'.