C# – Exception with crystal reports

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

Best Answer

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:

Related Topic