Skip to Content
0
Former Member
Nov 13, 2012 at 12:08 AM

"Could not load file or assembly" when trying to run Web Viewer

83 Views

Development machine is Windows 7 32-bit with Visual Studio 2008 and Crystal Reports 2008 SP2.

Server is Windows 2008 64-bit Server SP1.

I am trying to run a simple ASP.NET app on the server that uses the CrystalDecisions.Web.CrystalReportViewer (version 12.0.1100.0), and it's not working. I get the following error:

An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) that contains the version of the Crystal Reports runtime (x86, x64, or Itanium) that is required. Please go to http://www.businessobjects.com/support for more information.

I have the cr2008sp2_redistinstall installed on the server.

I read a suggestion somewhere to try compiling the dll for the application so it is targeting only a 32-bit CPU. When I tried that and replaced the app's dll on the server, the error message changed to:

Could not load file or assembly 'CrystalReportWVTest' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'CrystalReportWVTest' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Assembly Load Trace: The following information can be helpful to determine why the assembly 'CrystalReportWVTest' could not be loaded.

=== Pre-bind state information ===  
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = CrystalReportWVTest (Partial)
LOG: Appbase = file:///C:/inetpub/wwwroot/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/e22c2559/92c7e946/CrystalReportWVTest.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/e22c2559/92c7e946/CrystalReportWVTest/CrystalReportWVTest.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/bin/CrystalReportWVTest.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.


Any suggestions, please?