Click here to Skip to main content
15,890,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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

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.
 
Share this answer
 

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

  Print Answers RSS


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