37

For the following error:

Could not load file or assembly ‘file:///C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll’ or one of its dependencies.

Is there any way to resolve this error other than through the solution:

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
</startup>

That solution not work in my application

8 Answers 8

78

Please use this code. It may be helpful for you.

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

This is slightly different than you. For more details visit this link Crystal Report Viewer

5
  • "This is slightly different than you!" Exactly!
    – ABS
    May 8, 2015 at 9:31
  • Worked for me (.net 4.6.1) Dec 6, 2017 at 11:02
  • it worked for me, thanks, can u explain why this happened? Apr 16, 2018 at 7:27
  • Simply changing <startup> to <startup useLegacyV2RuntimeActivationPolicy="true"> is all I needed. May 17, 2018 at 16:56
  • Worked for me as well. .NET 4.7 Visual Studio 2017 Sep 10, 2019 at 18:13
12

Change the first line to work successfully

After you open a file "App.config" from Solution Explorer

Previous:

<startup> 

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>

Current:

<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
1
  • thank you for simple explanation it saved me from headache :) Feb 13, 2016 at 16:26
5

Use only

<startup useLegacyV2RuntimeActivationPolicy="true">
</startup>

It works for all frameworks!

0
2

This stuff basically happens, if you have correct setup of SBO (I wish you so:)), that between different components of your SBO SDK there are assemblies with different .NET version. Check if you have some old version of SAP BO SDK installed on your machine too. Hope this helps.

2

Do a clean install of Crystal Reports.

I had to uninstall all Crystal (Runtime and for Visual Studio) Then install only Crystal Reports for Visual Studio 2019 (SP26) At last I checked the checkbox for installing the runtime included in the "For Visual Studio" version.

1
  • Also delete the residual folder on the Program Files (or Program Files (x86)) after uninstallation. It is SAP something... Dec 5, 2023 at 4:56
1

Try inserting the code below at your app.config or web.config file:

<startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0"/>
</startup>
0

When facing this issue in ASP.Net application, check the application pool of the application in IIS. Change the Application pool to .Net 4.0 from .Net 2.0.

It will fix the issue.

-1

Follow steps: Right click on project then click properties ->compile ->Advance Compile Option -> click Target framework and select .Net Framework 3.5 -> Now Click OK

Thats the simple solution.

Not the answer you're looking for? Browse other questions tagged or ask your own question.