Click here to Skip to main content
15,899,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I install my VB.NET project setup in another system (system has no Visual Studio, Crystal Report 2008) shows "type initializer for module 1 threw an exception" error.

In module 1, I declared:

Public cryRpt As New ReportDocument,  Public crtableLogoninfos As New TableLogOnInfos, Public crtableLogoninfos As New TableLogOnInfos,  Public crtableLogoninfos As New TableLogOnInfos,  Public crtableLogoninfo As New TableLogOnInfo,   Public crConnectionInfo As New ConnectionInfo,Public CrTables As Tables, Public reportpath As String = Application.StartupPath.ToString, Public str As String,   Public CrystalReportViewerObject As Object,  Public ReportName As String , Public rptp As String = "",   Public Reportformula As String)


Can anybody help me, please.

My project is a VB.NET Windows application. In Visual Studio 2008, reports are in Crystal report 2008. The same setup is running on my PC without showing the error.

:~
Posted
Updated 23-Aug-10 8:18am
v4
Comments
tiggerc 23-Aug-10 7:38am    
Have you installed the crystal reports runtime, on the client pc.

1 solution

Search for the Crystal Reports Merge modules.
They should have a name equal or similar to 'CRRuntime_12_0.msm'.

You will have to search far and wide, but they are out there somewhere. I found them once, but remember it took me a long time to do so.

Then add those to your setup project.
Right click on setup project --> Add --> merge modules
Select the ones you need. (Typically 2 files (a language one and the full one))
Rebuild the setup and try again.

The reason you get this error on another PC but not yours is that you most likely have the Crystal reports designer installed on your PC and hence also all the needed DLLs to run the Crystal reports. The other PC doesn't have those DLLs, so it's throwing this error.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900