Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception with crystal reports

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.

like image 748
Maerorek Avatar asked Dec 12 '14 09:12

Maerorek


3 Answers

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:

  • CRVS2010- crdb_adoplus.dll not found
  • Could not load file or assembly crdb_adoplus.dll
like image 104
Richard Holyoak Avatar answered Oct 03 '22 04:10

Richard Holyoak


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

like image 33
Farhan Ali Surahio Avatar answered Oct 03 '22 03:10

Farhan Ali Surahio


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>
like image 26
J R B Avatar answered Oct 03 '22 05:10

J R B