8
votes

I am developing application which uses SAP Crystal Reports for reporting with Visual Studio 2013 Professional. I downloaded and install package from SAP site, install that. Report is prepared using wizard (this works correctly). Problem is if I following step in source code:

myCrystalReport.SetDataSource(myDataSet);

myDataSet is filled with required data. Displayed error is:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

Additional information: 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.

During installation folder dotnet1 were not created. There is only folder dotnet. Do somebody know how can be this problem resolved?

Thank you.

4
Did you try uninstalling crystal reports and install it again in a different path.Kushan Randima
Kushan I tried that. Moreover during installation there is no dialog, where I can choose installation directory. But i tried uninnstal it, and then install again. Result is the same - error above.Maerorek
Can you try by changing the .NET framework version? 4.5 is my preference. Please take a backup before doing that. Because some times it may screw-up the solution.Kushan Randima
Kushan Thanks, but this solution and all projects in this solution are based on .NET 4.5.1Maerorek

4 Answers

32
votes

I had the exact same problem. My solution was to add this xml to the app.config file inside the <configuration> level:

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

See also:

5
votes
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
</startup>
</configuration>

Due to mixed mode assemblies has changed this problem will occur so it is recommended to you use above code into app.config file.

3
votes

you have use below code in app.config and also have to set .net profile 4 client to .net profile 4 or 4.5 in project property.

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

All above solution not working in my project and application goes in break mode. i solve this problem by adding following lines in app.config inside the configuration.

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