Crystal Reports and .NET 4 - Could not load file or assembly (with useLegacyV2RuntimeActivationPolicy="false") crdb_adoplus.dll

14,518

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.

Share:
14,518
crunchy
Author by

crunchy

I'm a software developer who loves .NET!

Updated on June 27, 2022

Comments

  • crunchy
    crunchy almost 2 years

    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 (i.e. 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,

    • abstrask
      abstrask about 10 years
    • crunchy
      crunchy about 10 years
      If you look at the app.config code in my question you will see that it is identical to the accepted answer of the question you said my question "may be a duplicate" of, except that answer does not work for me. I also stated I read quite a few similar questions that did not solve my question which is the reason for my post. My question is not a duplicate, so please read the question more closely next time. Thank you.
    • Dan Sorensen
      Dan Sorensen over 9 years
      What version of Visual Studio are you using? (just checking as the older versions came with Crystal and the newer ones do not) I am having a similar issue on a project created in VS2008 and currently being maintained in VS 2013.
    • crunchy
      crunchy over 9 years
      I'm using VS 2012 and 2013 (I've actually tried in VS 2010 to no avail as well). I can't say for sure which version of VS this project was created in but I'm going to assume it was VS 2008.
  • crunchy
    crunchy almost 10 years
    I will definitely be giving this a try as soon as I get some free time. Thank you very much for the suggestion and hopefully I can mark this as the answer in the near future :)