我在 Visual Studio 中有一个 SharePoint WebPart 项目。作为项目的一部分,我引用了 interop.ActiveDS.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
我已将 [assembly: System.Security.AllowPartiallyTrustedCallers] 添加到 assemblyinfo.cs 文件,但这并没有帮助。
将不胜感激任何答案!