sharepointsharepoint-2010web-partsfarm-solutionsandbox-solution

Sandbox solutions seem to be too severely crippled


I am learning SharePoint and the different kind of solutions you can deploy. From the training I am watching it seems like you should try your best to use a Sandbox Solution when ever possible. This is because Farm Solutions can mess things up too much.

However, two of the main things I would do with WebParts are not supported in Sandbox Solutions. Those are Visual WebParts and WebPart communication. (The first is not allowed because it needs to hit the file system and the second is disallowed because it uses reflection).

It seems to me that my WebParts will always want to do at least one of those things. (WebParts that don't communicate are not really that modular are they?)

Am I missing the point or are Sandbox Solutions a "nice idea" that are not really used in actual code?


Solution

  • Yes, I agree with you that Sandbox solutions are very restrictive.

    But, it is that restriction that gives them their value. Due to the restrictions a Sandboxed solution cannot bring down a farm (atleast that is the theory, someone may find a way to do it).

    This means that you can open up to many more users to deploy things on the farm. It is also a requirement to deploy things to SharePoint Online.

    That Sandbox solutions are more restrictive, means that development is more cumbersome, you have to program your way around the restrictions. This makes solutions more expensive. Therefore, the default should be farm unless you have a good reason not to use it.