|
1
6
尝试使用 AddTrustedCodeModuleInCurrentAppDomain 方法 ReportViewer.LocalReport Property (reportviewer.localreport.addTrustedCodeModuleIncurrentAppDomain(“您的程序集”))。 同时确保使用 AllowPartiallyTrustedCallers 程序集的属性([程序集:allowPartyTrustedCallers])。 |
|
|
2
3
对于.NET 4.0,addTrustedCodeModuleIncurrentAppDomain方法已过时。Visual Studio 2010禁用此方法的调用。但是有 AddFullTrustModuleInSandboxAppDomain ReportViewer类(ReportViewer.LocalReport.AddFullTrustModuleInsandOxappDomain(MyAssemblyStrongName))的LocalReport属性中的方法。它需要程序集的强名称。当我从文件夹“bin”手动运行exe文件时,我的应用程序在Visual Studio中执行得很好,但我得到错误“报告引用了代码模块(我的模块),这不是可信的程序集”。它可能是什么? |