我在Visual Studio中有一个SharePoint WebPart项目。作为该项目的一部分,我引用了interop.ActiveDS.dll。SharePoint WebPart程序包和dll
我可以成功编译项目并将解决方案添加/部署到SharePoint。当我尝试运行在SharePoint中的WebPart我得到的错误:
That assembly does not allow partially trusted callers.
[SecurityException: That assembly does not allow partially trusted callers.]
PeopleAdWebPart.PeopleAdWebPart.OnLoad(EventArgs e) +0
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ProcessRequest(HttpContext context) +153
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
我已经添加[大会:System.Security.AllowPartiallyTrustedCallers]到AssemblyInfo.cs文件,但这并没有帮助。
希望能为此回答任何问题!