views:

417

answers:

1

I'm in the process of upgrading an existing ASP.NET2.0 application to .NET3.5 (moving from VS2005 to 2008 - yes I know I'm late!) and have encountered a problem with Crystal Reports.

Basically the following line of code causes the Webdev.WebServer.exe to close and the application to crash (I'm returned to VS).

CrystalDecisions.CrystalReports.Engine.ReportDocument rd = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

The line is in a Try/Catch but no exception is thrown at this point.

I've tried creating a new project just containing this line and it too crashes - so it's not the application itself.
I then tried using an older version of the dll (10.5.3700.0 instead of 11.5.3700.0) and it works fine in the dummy application. Obviously I'd rather not downgrade the real application but doing so does resolve the problem (I need to downgrade other CR dlls as well so it might have knock on effects in the application).

I cannot find any references to a later version of the DLLs and have downloaded the latest runtime package for VS2008 from Crystal Reports but this has made no difference - although the installer seemed to do nothing the Event Viewer confirms that installation was succesful.

Has anyone else experienced this or know of a way around it - apart from downgrading the dlls?

[Edit] I've been able to get around the problem by turning off Data Execution Prevention but this is not a viable solution - I have hardly tell the customer to do that! Besides, everything was running fine in VS2005/.NET2.0!

A: 

Well I may have found the answer here - it looks like Crystal Reports XI R2 (dll version 11.5.3700.0) is not compatible with VS2008.

This Business Objects document more or less confirms this although it is odd that v10.5 and 2008 (the releases either side of XI R2) are compatible. The document also says that Data Execution Prevention may need to be turned off but this (in my opinion) is just not viable.

I'm going to remove XI R2 and install 2008 instead and see how I go - I'll post back once I'm done.

[Edit] That did it! Strange that v10 and v12 are supported but v11 is not.

[Edit] Maybe I was quick to start feeling pleased with myself - while it now works on my local Development PC, deployment to the server is less straightforward. I've tried installing the correct runtimes but when the report viewer opens I just get an error message in the browser 'Can't Find File: C:\Windows\Temp\9as00af.dll'.

[Final Edit] Looks like I had to revert back to 10.5.3700.0 - i.e. the version of Crystal Reports that ships with VS2008. The installation of the runtime on the server then sorted the problem

DilbertDave