简体   繁体   中英

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. When I change all projects to point at .NET 4.0 my application runs fine until I try to open a 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:

  <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.

So my question is how I proceed from here? Leaving my application in .NET 3.5 is really only a temporary fix.

Could I toggle useLegacyV2RuntimeActivationPolicy at runtime (ie set it to true before I load a Crystal Report) or is this a hack / even possible?

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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM