Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / SharePoint / SharePoint2016

Sandboxed Solutions in SharePoint 2016

3.00/5 (2 votes)
25 Jul 2016CPOL1 min read 12.8K  
Sandboxed Solution deployment in SharePoint 2016

Introduction

We all know that Sandboxed solutions (custom managed code) have been deprecated from SharePoint 2013. So it is also deprecated in SharePoint 2016. The alternative of Sandboxed solution is App. But the good news is: existing Sandboxed solution still works in SharePoint 2016. There is an issue to deploy existing Sandboxed solution in SharePoint 2016 environment. It does not work seamlessly like SharePoint 2013. So we will see here how we can expedite Sandboxed solution in SharePoint 2016.

Installing Sandboxed Solution

If you try to install Sandboxed solutions using PowerShell in your SharePoint 2016 on-premise environment, then you will get the following error.

PowerShell Command

Install-SPUserSolution -Identity <Solution Name> -Site <Site Url>

Error

Install-SPUserSolution : Failed to activate this solution. The contents of the
solution require the Solution Sandbox service to be running.

ps error

What’s the Error

The error simply means that Microsoft SharePoint Foundation Sandboxed Code Service is not running on the server.

services on server

Solution

May be you already got that we have to start this service on the server but the problem is in SharePoint 2016, we cannot start any service from Manage services on server. It was possible in SharePoint 2013. You can check it from:

Central Admin –> Application Management –> Manage services on server

To start this service, you have to run the configuration wizard again. In SharePoint 2016, there is a new section in configuration wizard named Services. So look for the Microsoft SharePoint Foundation Sandboxed Code Service and mark the checkbox. Finally, run and finish your configuration wizard.

snadbox services

After running configuration wizard, check the Microsoft SharePoint Foundation Sandboxed Code Service and its status should show running.

services on server after

Now run the PowerShell command again to deploy your custom sandboxed solution.

Conclusion

You must have to perform this for production deployment. In the test or development environment, it is not required. Visual Studio will automatically do this for you to deploy and test your sandboxed solution!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)