Click here to Skip to main content
14,668,470 members
Rate this:
Please Sign up or sign in to vote.
I am running a VB.NET application with crystal reports but I encounter the error. 

{"The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception."}

The inner exception is	{"Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.":"CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"}	System.Exception {System.IO.FileNotFoundException}


What I have tried:

I read the solution I saw was to change the Target CPU to ANYCPU with unckecked prefer x32-bit 

The crystal report successfully ran but now when I run the application I encounter this error. 
"Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"

I was able to resolve the issue on the crystal reports but now encounter this error. I was wondering how to find the class that gets affected whenever I try the Target CPU. thank you. 
Posted
Updated 6-Jul-20 23:51pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Quote:
I was wondering how to find the class that gets affected whenever I try the Target CPU.
A tool I've found invaluable in the past is ProcMon which now comes as part of the (free) SysInternals Suite of tools - Sysinternals Suite - Windows Sysinternals | Microsoft Docs[^]

Here are the instructions for Process Monitor (aka "ProcMon") Process Monitor - Windows Sysinternals | Microsoft Docs[^] which can be downloaded as an individual tool

Basically you can track what Windows was attempting to load (literally the dll name and location), so you can work out what is not registered.
   

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

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100