0

Can TaxonomySession be used at SharePoint visual web part and web part on sandbox? I tested a simple code as following,

protected void Page_Load(object sender, EventArgs e) { try{
SPSite currentSite = SPContext.Current.Site; TaxonomySession taxonomySession = new TaxonomySession(currentSite); } catch (Exception ex) { } finally{} }

and got the error message as below,

Web Part Error: Sandboxed code execution request failed.

[SPUserCodeExecutionPipelineFailedException: Sandboxed code execution request failed.] at Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type userCodeWrapperType, SPSite site, SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartRemoteExecutionHelper.<>c_DisplayClassa.b_9() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartRemoteExecutionHelper.ExecuteRequestInSandBox(HttpContext context, SPWeb web, SPWebPartManager manager, SPUserCodeWebPart userCodeWebPart)

[RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.]

Server stack trace:

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinityBucketName, SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type userCodeWrapperType, SPSite site, SPUserCodeExecutionContext executionContext)

1 Answer 1

2

Microsodt.SharePoint.Taxonomy.dll isn't supported in Sandboxed solutions

For an overview of which parts of SharePoint is available see MSDN article Available and Unavailable SharePoint Assemblies from Sandboxed Solutions in SharePoint 2010

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.