in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, Office 365 / SharePoint Online and Visual Studio 2013.

Troubleshooting Sandboxed Solutions in SharePoint 2010

I have a talk coming up on Code Access Security at SharePoint Saturday Kansas City next month so I have been investigating sandboxed solutions quite a bit.  After all, sandboxed solutions are just another flavor of using CAS with some additional things thrown in.  However, after I got my SharePoint server installed and configured, I found that sandboxed solutions were not working.  When I configured my solution to use the sandbox and tried to deploy it, I got the following error.

Error occurred in deployment step 'Activate Features': Cannot start service SPUserCodeV4 on computer 'servername'.

I found that to be odd, so I decided to do some looking around.  I ended up in the Windows Services MMC snapin and found that the service called Windows SharePoint Services UserCode Host v4 was in fact set to disabled.  I changed this to automatic and started the service up.  I tried to deploy again, but unfortunately things still weren’t working.  Here is the error I got this time.

Error occurred in deployment step 'Activate Features': This feature cannot be activated at this time. The contents of the feature's solution requires the Solution Sandbox service to be running.

This one took a little bit more digging, but I ended up going to Central Administration and looking at the Services on Server page.  I thought what I needed would be under Service Applications, but that was not the case.  I took a look at Services on Server and quickly discovered that the Microsoft SharePoint Foundation User Code Service had not been started.  I started the service and then I tried to deploy again and the errors went away and my sandboxed web part worked as expected.  I’m not sure why neither of these started.  It could be because I don’t have enough memory allocated to the virtual machine or maybe it’s always disabled by default.  Anyhow, be sure and check these two things before you try to work in the sandbox.

UPDATE: @MSwannMSFT confirmed for me that this is by design.  It’s disabled for performance and security since it spins up three new processes.

Comments

 

Twitter Trackbacks for Troubleshooting Sandboxed Solutions in SharePoint 2010 - Corey Roth - DotNetMafia.com - Tip of the Day [dotnetmafia.com] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Troubleshooting Sandboxed Solutions in SharePoint 2010 - Corey Roth - DotNetMafia.com - Tip of the Day         [dotnetmafia.com]        on Topsy.com

November 30, 2009 2:45 PM
 

Shantha Kumar said:

Hi CoreyRoth,

By default Microsoft SharePoint Foundation User Code Service is  not started. We have to start this service  before deploy a  sandboxed solutions on SiteCollection.

November 30, 2009 11:11 PM
 

sachin said:

It's help me. thanks alot for your comments

March 1, 2010 6:24 AM
 

bharani said:

i have service running in MMC and in CA as well. still when I try to add a sandboxed web part i get error message like " The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request."

Please help me.

May 10, 2010 3:48 AM
 

| Randomizzzer | Debugging SharePoint 2010 SandBoxed applications created in VS2010 | said:

Pingback from  | Randomizzzer | Debugging SharePoint 2010 SandBoxed applications created in VS2010 |

July 9, 2010 4:22 AM
 

mehmet rasim inceoglu said:

thank you, it solved my problem...

August 23, 2010 4:41 AM
 

Laurie said:

Thank you.

August 24, 2010 2:56 PM
 

Paul T. Lambert said:

Starting the SharePoint service in Central Administration also enables and starts the SPUserCodeV4 Windows service.  Moreover, this also silently changes the logon user and password for the SPUserCodeV4 service.  Woe is you if that user or password is incorrect -- there isn't even an error code in Event Viewer.

October 12, 2010 9:37 PM
 

George said:

hmmm.... this sound slike it could be my problem - I don't even have the "Microsoft SharePoint Foundation User Code Service" in my list of services, so am unable to restart it! - any ideas?

November 16, 2010 7:38 AM
 

CoreyRoth said:

@George Interesting.  What version of SharePoint are you running?  Is this a multiple server environment?

November 22, 2010 4:58 PM
 

SharePoint Developer Team Blog said:

  In this post I list some developer resources for learning about sandboxed solutions in SharePoint

January 21, 2011 1:17 PM
 

Sreekanth said:

Hi friend for this problem in my machine i am start following

Service. that is

"Microsoft SharePoint Foundation Sandboxed Code Service".

path=    

Central Administration -> System Settings -> Manage services on server -> Microsoft SharePoint Foundation Sandboxed Code Service -> start

May 7, 2011 3:23 AM
 

Blog del CIIN said:

Como sabéis, con SharePoint 2010 se introduce el concepto de solución sandbox o lo que

June 23, 2011 4:36 PM
 

SharePoint 2010: Recursos para la creación de soluciones SandBox! « Pasi??n por la tecnolog??a… said:

Pingback from  SharePoint 2010: Recursos para la creación de soluciones SandBox! « Pasi??n por la tecnolog??a…

June 23, 2011 4:40 PM
 

Huy said:

On the sharepoint server, in the system32\driver\etc\hosts, add

127.0.0.1 crl.microsoft.com

Problem sovled

August 10, 2011 4:17 AM
 

Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 | Faister's Blog said:

Pingback from  Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 | Faister's Blog

November 28, 2011 7:31 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an Applications Architect at Infusion specializing in ECM and Search.
2012 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems