vb.net Crystal Reports 和 .NET 4 - 无法加载文件或程序集(使用 useLegacyV2RuntimeActivationPolicy="false")crdb_adoplus.dll
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21000408/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Crystal Reports and .NET 4 - Could not load file or assembly (with useLegacyV2RuntimeActivationPolicy="false") crdb_adoplus.dll
提问by crunchy
A little background - my application is currently built in .NET 3.5 but I would like to migrate it to .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 3.5 中构建的,但我想将其迁移到 .NET 4.0。当我将所有项目更改为指向 .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". I assume this is due to the fact some of their Tax Engines are pre v4 assemblies.
但是,此解决方案对我不起作用。我在我的项目中使用了另一个程序集(更具体地说,Intuit 的 ProFile),一旦我设置了 useLegacyV2RuntimeActivationPolicy="true",它就不起作用。我认为这是因为他们的一些税务引擎是 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 (i.e. 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,
谢谢,
回答by John Cruz
Something is out of sync on your runtime install/deployment. It should not be looking for "dotnet1" folder. Try removing all of the Crystal assemblies. Set project for .Net 4. Install the VS 2010 Crystal add-on, then install whatever SP of runtime engine.
您的运行时安装/部署出现了不同步的情况。它不应该寻找“dotnet1”文件夹。尝试删除所有 Crystal 组件。为 .Net 4 设置项目。安装 VS 2010 Crystal 附加组件,然后安装运行时引擎的任何 SP。

