Troubleshooting Sandboxed Solutions in SharePoint 2010

Posted Monday, November 30, 2009 1:08 PM by CoreyRoth

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

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

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Monday, November 30, 2009 11:11 PM by Shantha Kumar

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.

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Monday, March 1, 2010 6:24 AM by sachin

It's help me. thanks alot for your comments

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Monday, May 10, 2010 3:48 AM by bharani

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.

# | Randomizzzer | Debugging SharePoint 2010 SandBoxed applications created in VS2010 |

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

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Monday, August 23, 2010 4:41 AM by mehmet rasim inceoglu

thank you, it solved my problem...

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Tuesday, August 24, 2010 2:56 PM by Laurie

Thank you.

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Tuesday, October 12, 2010 9:37 PM by Paul T. Lambert

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.

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Tuesday, November 16, 2010 7:38 AM by George

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?

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Monday, November 22, 2010 4:58 PM by CoreyRoth

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

# Learning Resources for SharePoint Sandboxed Solutions (Ricky Kirkham)

Friday, January 21, 2011 1:17 PM by SharePoint Developer Team Blog

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

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Saturday, May 7, 2011 3:23 AM by Sreekanth

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

# SharePoint 2010: Recursos para la creación de soluciones SandBox!

Thursday, June 23, 2011 4:36 PM by Blog del CIIN

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

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

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

# re: Troubleshooting Sandboxed Solutions in SharePoint 2010

Wednesday, August 10, 2011 4:17 AM by Huy

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

127.0.0.1 crl.microsoft.com

Problem sovled

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

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

Leave a Comment

(required) 
(required) 
(optional)
(required)