crdb_adoplus.dll Unit Test Solution - c#

I am having trouble in VS2012 Unit Test Project with SAP Crystal Reports.
Below error is generated while in test case.
ReportDocument rd = new ReportDocument();
rd.SetDataSource(dataset); // Getting below quoted error.
Error.
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 tried this link but it didn't worked for me.
Could not load file or assembly crdb_adoplus.dll

You need to make the change in the test runner config file i.e.
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.x86.exe.config

A similar solution to the one you have linked.
Change it however
from:
<!--<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>-->
to:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>

Related

Crystal Report Loading Error in VS 2010 C#

I'm doing a project in c# 2010 that generate reports. I want to use Crytal Report for reporting on the project but getting the following error -
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.
Can anyone help me out this error.
To solve this error.You have to add following code to your app.config file.
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

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

Runtime error in crystal reports 2010

When i try to run program (VS2010, .net4.0 full profile) that use Crystal reports 2010 in another computer from my develop machine, i get this error:
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
I try to google how to solve the problem, but editing config.app didnt work. My config.app:
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<connectionStrings />
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
The crystal reports got some problems here i think, when i try to run application with reports on another machine first time it didnt find crdb_adoplus.dll because it wasnt even exist in location that it should be. I have to create a new folder and copy some files from C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet' to ...dotnet1. The error that i solved was:
I get this missing file error:"Could not load file or assembly file:///C:\Program Files\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."
How to solve this? Thanks at all.
I think you should change the version of asp.net from version 4 to version 2 in IIs...
try it

Crystal reports error in SetDataSource

I am having trouble in VS 2010 sap crystalreports, using c# to make a windows application.
I get the following error with the following code:
CrystalReport1 cr1 = new CrystalReport1();
cr1.SetDataSource(dt1); //Error
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\win64_x64\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.
Try using this solution by adding the useLegacyV2RuntimeActivationPolicy attribute to your .config file
<startup useLegacyV2RuntimeActivationPolicy="true">
<startup useLegacyV2RuntimeActivationPolicy="true" >
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
Add this code in app.config.
You probably need to install the crystal reports runtime files. You should be able to do a google search to find them. The error message is pretty explicit in telling you the problem is a missing .dll. Read it ;)
edit: Try locating the crdb_adoplus.dll on your machine and copying it to the application directory.

Crystal Reports are not working in Visual Studio 2010

When i execute crystal report it gives an error
Could not load file or assembly 'crdb_adoplus, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
Place this code in your app.config
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.2"/>
</startup>
If it would not work then download Crystal Report Runtime from this link http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_32bit_13_0_1.msi
If again Crystal Report create some problem then right click on your project, open Properties, open Debug tab and check option Enable Unmanaged code debugging.
If you are running .Net 4 in VS2010, then you may need to add the following to your .config file (configuration section):
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
If this doesn't work, then you need to upgrade to Crystal Report for VS2010 from this link.
Add this code in app config
<startup useLegacyV2RuntimeActivationPolicy="true"> </startup>
If you have visual studio 2010 in your system then crystall report is not install because there is no any crystal report with visual studio 2010.for open the crystal or .rpt file install the sap crystal report 2010.It willl downloaded from sap object websit.

Categories