I am testing out Visual Studio 2010.
I have created a sandboxed solution with a webpart. It deployed OK.
I then tried adding a dll to the solution that would contain the business logic. This dll is signed with it's own strong name key.
We I now deploy the solution, I get the following error when the code tries to use the business logic dll:
Web Part Error: Unhandled exception was thrown by the user code wrapper's Execute method in the partial trust app domain: System.Security.SecurityException: That assembly does not allow partially trusted callers. at SharePointProject1.WebPart1.WebPart1.button_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.ExecuteHttpRequest(SPUserCodeWebPartHttpRequestContext webPartExecutionContext, SPUserCodeWebPartHttpResponse httpRequestResponse) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext) The action that failed was: LinkDemand The assembly or AppDomain that failed was: SharePointProject1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0b5230b1615a26d4 The method that caused the failure was: System.String Toggle(System.String) The Zone of the assembly that failed was: MyComputer The Url of the assembly that failed was: file:///C:/ProgramData/Microsoft/SharePoint/UCCache/8CCB51CC8164124/CF0F683C1542422E80050AFD2BD3D785%2DHbWRnjvb49VmZuA5OCXjhZbPX0JMH5a6kSdXvb4VoxE%3D-8/SharePointProject1.dll
Anybody know how to fix this?