Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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)

share|improve this question
add comment

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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