Showing posts with label Sandbox Solution. Show all posts
Showing posts with label Sandbox Solution. Show all posts

Wednesday, 6 July 2011

Error : Sandboxed Solution deploy

I created a sandbox solution. While working on the solution I added a Sharepoint mapped image folder to the solution. In visual studio when I clicked deploy of the project I encountered the following error.
The deployment type "TemplateFile" of file "ALLMTGS.GIF" in Project Item "Images" is not compatible with a Package in a Sandboxed Solution.
The Project Item "Images" cannot be deployed through a Package in a Sandboxed Solution.


Solved:
The cause of the problem was that, I created a Sandboxed solution. A Sandboxed solution does not support disk operations. I changed the solution type from Sandboxed to farm solution and the deployment worked fine. Below are the steps I followed in visual studio to change the sandboxed solution to a farm solution.
  1. In the solution explorer, select the sharepoint project that is to be deployed
  2. With the selection on the project, navigate to the properties window (press F4)
  3. Change the value of the property 'Sandboxed Solution' to 'false'
  4. An alert will be displayed asking if you have farm administrator previleges. Click 'OK'

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">