Once when I started to work over the project which used about 30 SharePoint Lists and their data should be displayed on some interfaces, I decided to use Sandboxed solution. When I started Visual studio and began to write code, everything was fine. No restarting IIS after deploying, I could easily press F5 and not to wait for restarting application pool in 1 or 2 minutes.

It was on my developer machine. But when I installed Sandboxed Solution on a farm, my solution wasn’t so good as on developer machine. It had always displayed errors that there’s no resources for executing Sandboxed solution.

I should say that Front-end servers of SharePoint farm in our organization on that moment were loaded on 50-60% and common farm solutions worked correctly. Then I decided to convert my Sandboxed solution to a farm solution.

In Visual studio I have changed value of "Sandboxed solution" to "False", deployed it and built my solution (Package).

Visual studio - change solution from Sandboxed to Farm

Visual studio - change solution from Sandboxed to Farm

When I opened a page with one of web-parts from solution, I got the error that my solution isn’t found. I used to press edit page, delete lost web part and add web part with same name again. On a machine with Visual studio and standalone installation of SharePoint that was enough.

So I prepared to install it on a productive farm. I will describe only the correct way to change Sandboxed SharePoint solution to a Farm one. I will do it not to repeat my mistakes and not to spend a time.

First I needed to delete my Sandboxed solution. I decided to do it using PowerShell (My solution is called "MySolution.wsp")

$url = "http://spdev"
Uninstall-SPUserSolution -Identity MySolution.wsp -Site $url
Remove-SPUserSolution -Identity MySolution.wsp -Site $url

 

After that you need to delete WebParts from site. Go to Web Parts collection list http://spdev/mysite/_catalogs/wp/Forms/AllItems.aspx and delete all the webparts which your solution contains. If you don’t do it, you won’t be able to use your webparts because they won’t be updated.

Only after this you may add and deploy your farm solution:

Add-SPSolution -LiteralPath D:\Solutions\MySolution\MySolution.wsp
Install-SPSolution –Identity MySolution.wsp –GACDeployment –force

 

And don’t forget to activate feature of solution in Site Collection features after deploying.