Wednesday, March 4, 2009

error The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' while asp.net 2.0, crystal report 10 deployment

Hi,

I have developed a web application using Asp.net 2.0, Crystal report 10, Ajax, Sql server 2k.
Crystal report work fine on development machine. but once i tried to deploy it in production environment ( windows server 2003, iis 6.0).

I came across following error while executing the Crystal report on production server

error The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument'.

after googling it for quite some time.. i came across one of the post on msdn forum.

The solution is :

Open the asp.net 2.0 web application to be deployed in visual studio 2005

Add New project -> select the Setup and deployment from left pane and WebSetup from right pane.

click on the setup project and then click on properties.

From there click on the prerequisite button.

Check Crystal Reports for .Net Framework 2. (and other necessary dependencies like MDAC 2.8)

I then selected download prerequsites from the same location as my application.

Rebuild the setup project.

Go to the WebSetup Project folder, you will find CRRedist2005_x86.msi file under CrystalReport Folder (under Release or Debug folder, which ever u selected prior to building the websetup) .

I ran this CRRedist2005_x86.msi file on the Production machine and it worked like charm

I hope it helps.
Cheers
Happy Programming
Source : msdn.microsoft.com

Add to Technorati Favorites

No comments:

Post a Comment