Sandboxed Solution & SharePoint Online Compatibility

In this article we can explore Compatibility of Sandboxed Solution with SharePoint Online.

Scenario

I am seeing that many developers are recommending Sandboxed Solutions for On-Premise and Online deployments.

But, the Twist is that SharePoint Online does not support all sandboxed solutions. So if your solution has a Strategy Architecture comprising of SharePoint Online, you need to be really careful recommending Sandboxed Solutions.

Recommendation

Sandboxed Solution is of two types:

1. No-Code Sandboxed Solution (NCSS)

2. Code Sandboxed Solution

image

NCSS contains only HTML & CSS markups. No code will be there.

Recommendation

NCSS is the recommended & only allowed one in SharePoint Online.

Testing

Create a new Sandboxed Solution.

image

Add a Visual Web Part. Do not add any code. Build the project.

Now Upload the NCSS and we get the Activate button enabled. This proves No-Code Sandboxed Solutions can be activated in SharePoint Online. (as of today)

image

Now come back to Visual Studio & Add place a button on the Visual Web Part.
image

Add code to the click event handler.

image

Build the project.

Now upload the Coded Sandboxed Solution to SharePoint Online. You can see the Activate button is disabled.

image
So this demonstrates that SharePoint Online does not support Coded Sandboxed Solutions.

image

Sandboxed Solutions were the Solutions of the past and now being deprecated. In the modern SharePoint development world REST, CSOM, Apps are the recommended approaches. Plus, there is a risk that Sandboxed Solution can get disabled in future versions of SharePoint/Online.

References

https://blogs.msdn.microsoft.com/sharepointdev/2014/01/14/deprecation-of-custom-code-in-sandboxed-solutions/

Summary

In this article we have explored Compatibility of Sandboxed Solution with SharePoint Online.

Leave a Reply

Your email address will not be published. Required fields are marked *