http://sharepointinfoit.wordpress.com/2011/12/27/the-sandboxed-code-execution-request-was-refused-because-the-sandboxed-code-host-service-was-too-busy-to-handle-the-request/
hi there i am writing this blog in regards following error in Sharepoint 2010 SandBo,i am assuming that your Microsoft SharePoint Foundation Sandboxed Code Service is run
“The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request”
Some developers are getting this error whenever they try to use a sandboxed solution, or sometimes when they add a sandboxed Web Part to a page, even in circumstances in which the service could not be busy. There seem to be multiple things that can cause this. The following are some solutions that have worked for me
when you try to add sandbox web-part to page it try’s to check for certificate revocations at crl.microsoft.com
so you need to make entry in C:\Windows\System32\drivers\etc host file
127.0.0.1 crl.microsoft.com
then save the file and you can either run below Script or cope this script and save it in PS1 format and run it directly on server
This Code from another site, I tried it first but it did not work
----------------------------------------------------------------------------------
This is the script:
Write-Host -ForegroundColor White “Getting ‘Sandboxed Code Service’ instance on current server…”
$srvInstance = Get-SPServiceInstance -Server $env:ComputerName | where {$_.TypeName -eq “Microsoft SharePoint Foundation Sandboxed Code Service”}
Write-Host -ForegroundColor White “Getting SID of process identity that runs Sandbox service instance…”
$sid = $srvInstance.Service.ProcessIdentity.CurrentSecurityIdentifier.Value
$path = “Registry::HKEY_USERS\$sid\SOFTWARE\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing”
$key = “State”
$oldValue = (Get-ItemProperty -path $path).$key
$newvalue = 0x00023e00
$hexOldValue = “{0:x}” -f $oldValue
$hexNewValue = “{0:x}” -f $newvalue
Write-Host -ForegroundColor White “Current registry value is: $hexOldValue”
If ($oldValue -eq $newvalue)
{
Write-Host -ForegroundColor White “No change is required.”
} else {
Set-ItemProperty -path $path -name $key -Type DWORD -Value $newvalue
Write-Host -ForegroundColor White “Registry value is set to: $hexNewValue”
If ($srvInstance.Service.Status -eq “Online”)
{
Write-Host -ForegroundColor White “Restarting Sandbox service…”
Restart-Service SPUserCodeV4
Write-Host -ForegroundColor White “Restarting IIS…”
iisreset -noforce
}
}
hi there i am writing this blog in regards following error in Sharepoint 2010 SandBo,i am assuming that your Microsoft SharePoint Foundation Sandboxed Code Service is run
“The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request”
Some developers are getting this error whenever they try to use a sandboxed solution, or sometimes when they add a sandboxed Web Part to a page, even in circumstances in which the service could not be busy. There seem to be multiple things that can cause this. The following are some solutions that have worked for me
when you try to add sandbox web-part to page it try’s to check for certificate revocations at crl.microsoft.com
so you need to make entry in C:\Windows\System32\drivers\etc host file
127.0.0.1 crl.microsoft.com
then save the file and you can either run below Script or cope this script and save it in PS1 format and run it directly on server
This Code from another site, I tried it first but it did not work
----------------------------------------------------------------------------------
$uc = [Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$uc.WorkerProcessExecutionTimeout = 5000
$uc.Update()
$tier = $uc.Tiers[""] # default Tier has no Name
$tier.MaximumWorkerProcesses = 2 # number of CPU Cores + 1
$tier.Update()
---------------------------------------------------------------
This is the script:
Write-Host -ForegroundColor White “Getting ‘Sandboxed Code Service’ instance on current server…”
$srvInstance = Get-SPServiceInstance -Server $env:ComputerName | where {$_.TypeName -eq “Microsoft SharePoint Foundation Sandboxed Code Service”}
Write-Host -ForegroundColor White “Getting SID of process identity that runs Sandbox service instance…”
$sid = $srvInstance.Service.ProcessIdentity.CurrentSecurityIdentifier.Value
$path = “Registry::HKEY_USERS\$sid\SOFTWARE\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing”
$key = “State”
$oldValue = (Get-ItemProperty -path $path).$key
$newvalue = 0x00023e00
$hexOldValue = “{0:x}” -f $oldValue
$hexNewValue = “{0:x}” -f $newvalue
Write-Host -ForegroundColor White “Current registry value is: $hexOldValue”
If ($oldValue -eq $newvalue)
{
Write-Host -ForegroundColor White “No change is required.”
} else {
Set-ItemProperty -path $path -name $key -Type DWORD -Value $newvalue
Write-Host -ForegroundColor White “Registry value is set to: $hexNewValue”
If ($srvInstance.Service.Status -eq “Online”)
{
Write-Host -ForegroundColor White “Restarting Sandbox service…”
Restart-Service SPUserCodeV4
Write-Host -ForegroundColor White “Restarting IIS…”
iisreset -noforce
}
}




