In this article we can explore Compatibility of Sandboxed Solution with SharePoint Online.
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.
Sandboxed Solution is of two types:
1. No-Code Sandboxed Solution (NCSS)
2. Code Sandboxed Solution
NCSS contains only HTML & CSS markups. No code will be there.
NCSS is the recommended & only allowed one in SharePoint Online.
Create a new Sandboxed Solution.
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)
Now come back to Visual Studio & Add place a button on the Visual Web Part.
Add code to the click event handler.
Build the project.
Now upload the Coded Sandboxed Solution to SharePoint Online. You can see the Activate button is disabled.
So this demonstrates that SharePoint Online does not support Coded Sandboxed Solutions.
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.
In this article we have explored Compatibility of Sandboxed Solution with SharePoint Online.