cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Nathan

I moved your post to the SAP Crystal Reports, version for Visual Studiodiscussion space.

Make sure your app pool on the WIN 2008 Server is set to 32 bit.

What is the version of the assembly CrystalDecisions.CrystalReports.Engine.dll referenced in your project?

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Hi! Thanks for the advice.

I tried setting the app pool to enable 32 bit, but it didn't help.

The CrystalReports.Engine reference is for version 12.0.2000.0

former_member183750
Active Contributor
0 Kudos

And the runtime you deploy is from here:

http://scn.sap.com/docs/DOC-27917

??

If so, I'd like you to use Process Monitor, see what is happening when the process is trying to load the CR runtime.

- Ludek

Former Member
0 Kudos

Yes I installed the SP2 runtime from there, as I am running CR SP2 on my development computer. Before that, though, I also installed the actual Crystal Reports SP3 on the server.

I also installed the CRforVS_redist_install_32bit_13_0_3 and the CRforVS_redist_install_64bit_13_0. Would those be causing conflicts?

I installed Process Explorer, but I'm not sure what to watch for. I do notice that when I try to run the asp.net page, a process called w3wp.exe shows up green under svchost.exe. Do you need information about that or is there something else I should be looking for?

former_member183750
Active Contributor
0 Kudos

Umm, a bit of confusion here. In your original post you say:

Visual Studio 2008 and Crystal Reports 2008 SP2. 

Server is Windows 2008 64-bit Server SP1.

But in the last post you say:

Yes I installed the SP2 runtime from there, as I am running CR SP2 on my development computer. Before that, though, I also installed the actual Crystal Reports SP3 on the server.

I also installed the CRforVS_redist_install_32bit_13_0_3 and the CRforVS_redist_install_64bit_13_0. Would those be causing conflicts?

CR 2008 uses runtime dlls of version 12.x. CRforVS_redist_install_32bit_13_0_3 is a runtime for Crystal reports for Visual Studio 2010 (CRVS2010), versioned as 13.x.

So. If the CR references in your project are version 12.x, then you need to deploy version 12.x runtime. That you will find here:

http://scn.sap.com/docs/DOC-27917

The runtime here:

http://scn.sap.com/docs/DOC-7824

is for CRVS2010 and if your references are 12.x, you do not want these files.

- Ludek

Answers (0)