Recently, I upgraded a Windows Forms project from .NET 3.5 to .NET 4.0 (VS2008 -> VS2010). Everything worked fine until I tried to view a Crystal Report. A little research led me to discover that Crystal Reports is not shipped with Visual Studio any longer, so first you have to download it from here. Good, now everything should work, right? Not in my case. The report in question uses a .NET class as it's datasource. In other words, it's using the ADO.NET data provider. So I get this informative little error message:
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.
After a little reasearch, I found in the Release Notes for CR, that
"A report based on an ADO.NET DataSet will not work if the project targets the 4.0 .NET Framework"
As a workaround, add following part into app.config or web.config files:
That did the trick for me. Now everything's dandy again.