Skip to Content
0
Former Member
Jan 15, 2011 at 02:27 AM

The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exc

3448 Views

I'm new to Crystal Reports and trying to work my way into it.

I created a form and dropped a CrystalReportViewer onto it. I set the ReportSource to a .rpt file that I also created.

When I run my VB.NET 2010 application and click the button to open up the Viewer form I get the following error:

The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception.

The details says that it's the log4net error that I've seen on here in several threads. I followed these directions from another thread:

- Go into your project Properties.
- Then go to the Publish tab. 
- Click the Application Files button.
- Select to Exclude any file with CrystalDecisions or BusinessObjects in the name. Plus exclude log4net.dll.
- Click OK
- Rebuild your application, then republish it to your site or file share to be installed by your clients.

No luck with that.

I then tried changing my my compile options from AnyCPU to x86 but that crashes the program on startup by complaining about my OdbcConnection.

Any suggestions are greatly appreciated.

I'm running Visual Studio 2010 on a Win 7 64-bit computer. I tried the same process in a new project and it worked there, but without actually connecting to a DSN database. I assume I have something configured wrong in my actual application but I don't know enough about Crystal Reports yet to know what to look for.

Edited by: wolfmanyoda on Jan 15, 2011 4:14 AM