I have a couple of CRVS 2010 reports built into a C# application which already existed as a .NET Framework 2 application (VS 2005) before I updated to VS 2010 and added the reports within the VS2010 environment whilst still compiling with .NET Framework 2. Everything worked fine until I started compiling with .NET Framework 4. I now get the error message which a lot of other people seem to have had:
Die Datei oder 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" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
I have also carried out just about all the steps that various people have advised - installed the redistributable runtime with the msi file so that the merge modules are also installed, added the following to the application's app.config file:
<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
I normally compile as Any CPU. I have now also tried compiling for x86 only, as the target system is 32-bit XP Service Pack 3, but it makes no difference. (my developer PC is running Windows 7 64 bit, which I don't think can be an issue as the setup is identical to when I was compiling with .NET2 and it worked fine - just have to install the right runtime and provide the right support dlls).
I have also:
In increasing desperation installed a copy of crdb_adoplus.dll at precisely the path in the error message
Downloaded and installed the latest versions of the runtime and the support pack
My code looks like this:
CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
report.Load(Application.StartupPath + @"\Templates\EinlagernDE.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy);
report.SetDataSource(dt); //DataTable
report.Refresh();
report.PrintToPrinter(1, false, 1, 1);
If anyone has any suggestions as to what is going wrong here I'd be most grateful to hear them - this little problem is preventing me from rolling out a number of associated .NET modules.