The title says it all... I am trying to programmatically activate some sandbox features (from within a feature reciver that is also part of the sandbox solution). And whilst the features without receivers all activate fine, those with receivers fail with the following exception:
The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request.
To reiterate, this only happens for custom sandbox features which have feature receivers attached -- even if the feature receivers are completely empty.
Does anyone know why this is occurring? And if so, how I can work around it?
FYI #1: For anyone trying to replicate this, you need to use the following overload (passing in SPFeatureDefinitionScope.Site) to programmatically activate a feature from a sandbox solution:
SPFeatureCollection.Add Method (Guid, Boolean, SPFeatureDefinitionScope)
FYI #2: This same error message also appear misleadingly in a number of other situations. None of the issues addressed here seem to solve my issue.
FYI #3: Perhaps this blog post is related to my issue though?
UPDATE #1: I am able to successfully activate all of my sandbox features (which have receivers) via the UI.
UPDATE #2: I am also able to successfully activate all of my sandbox features programmatically from a within farm feature's receiver.
UPDATE #3: I am not able to programmatically activate my sandbox features using the SharePoint client object model as the Micrsoft.SharePoint.Client.dll assembly cannot be called from within the sandbox (from partially trusted callers).