[英]Crystal Reports and .NET 4 - Could not load file or assembly (with useLegacyV2RuntimeActivationPolicy=“false”) crdb_adoplus.dll
A little background - my application is currently built in .NET 3.5 but I would like to migrate it to .NET 4.0.一点背景知识 - 我的应用程序目前是在 .NET 3.5 中构建的,但我想将其迁移到 .NET 4.0。 When I change all projects to point at .NET 4.0 my application runs fine until I try to open a Crystal Report.当我将所有项目更改为指向 .NET 4.0 时,我的应用程序运行良好,直到我尝试打开 Crystal Report。
My error is as follows:我的错误如下:
Could not load file or assembly 'file:///C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.
I've searched and there are quite a few answers to this question in the form of adding variations of the following to the app.config:我已经搜索过,这个问题的答案很多,都是在 app.config 中添加以下内容的变体:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
However, this solution does not work for me.但是,此解决方案对我不起作用。 I use another assembly in my project (more specifically, Intuit's ProFile) which does not work once I set useLegacyV2RuntimeActivationPolicy="true".我在我的项目中使用了另一个程序集(更具体地说,Intuit 的 ProFile),一旦我设置了 useLegacyV2RuntimeActivationPolicy="true",它就不起作用。 I assume this is due to the fact some of their Tax Engines are pre v4 assemblies.我认为这是因为他们的一些税务引擎是 v4 之前的程序集。
So my question is how I proceed from here?所以我的问题是我如何从这里开始? Leaving my application in .NET 3.5 is really only a temporary fix.将我的应用程序留在 .NET 3.5 中实际上只是一个临时修复。
Could I toggle useLegacyV2RuntimeActivationPolicy at runtime (ie set it to true before I load a Crystal Report) or is this a hack / even possible?我可以在运行时切换 useLegacyV2RuntimeActivationPolicy(即在加载 Crystal Report 之前将其设置为 true)还是这是一个黑客攻击/甚至可能?
Is there a better way?有没有更好的办法?
Any insight would be greatly appreciated.任何见解将不胜感激。
Thanks,谢谢,
Something is out of sync on your runtime install/deployment.您的运行时安装/部署出现了不同步的情况。 It should not be looking for "dotnet1" folder.它不应该寻找“dotnet1”文件夹。 Try removing all of the Crystal assemblies.尝试删除所有 Crystal 组件。 Set project for .Net 4. Install the VS 2010 Crystal add-on, then install whatever SP of runtime engine.为 .Net 4 设置项目。安装 VS 2010 Crystal 附加组件,然后安装运行时引擎的任何 SP。
C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll
Upload in path in error then continue.在错误的路径中上传然后继续。 It will work.它会起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.