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

Hello Sitepointers,

I’ve got this problem for a week now, hopefully anyone can help me.

I’m using Visual Studio 2005 and Crystal Reports XI Release 2 and deploying on a Windows Server 2008 x64 with IIS 7.0 (running on x86).

The stupid thing is, everything was running fine, untill I’ve had to reinstall Windows XP on the developer machine. Now I can not get it running again.

This is the error I’ve got on my deployment server:

The type initializer for ‘CrystalDecisions.CrystalReports.Engine.ReportDocument’ threw an exception. —> Retrieving the COM class factory for component with CLSID {5EFA39FA-B2C4-4A6E-84D6-C3333D1A3D07} failed due to the following error: 80040154.

Apperently it cannot find the appropiate dll’s.
The applications which are working (before my reinstall of windows xp) the dll’s in the references of the project are in the c:\windows\assembly folder.
Now with my fresh install the dll’s references are looking in this folder: C:\Program Files\Business Objects\Common\3.5\managed\dotnet2\CrystalDecisions.CrystalReports.Engine.dll.

How can I get my project references to look in the c:\windows\assembly folder?

Its a COM DLL, not .NET so it shouldn’t look in the global assembly cache. Did you reinstall the crystal reports runtime when you reinstalled XP?

Thanks, you’re right.

I’ve had to install an other redist. package, it was located here:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\CrystalRedist115_x86.msi

Now it works, but It’s still strange that previously it all worked fine without this package installed.

Probably got installed with another application that wasn’t reinstalled on the dev machine.