Error "System.BadImageFormatException" when trying to run Visual COBOL ASP.NET web application under Local IIS web server

Error "System.BadImageFormatException" when trying to run Visual COBOL ASP.NET web application under Local IIS web server

Problem:

Customer has an ASP.NET Web Application developed in Visual COBOL 2.1 for Visual Studio 2010. This is running on a Windows 7 64-bit computer.

It runs fine when the debugging tab is set to ues the Visual Studio Development Web Server. Customer changed the debugging tab to Use Local IIS Web Server instead and now it reports the following error:

Could not load file or assembly 'progname' 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 'progname' or one of its dependencies.

What is causing this?

Resolution:

The problem can occur because you have built your web application as x86 (32-bit) and you are running this on a 64-bit operating system. The default in IIS 7 when running on a 64-bit operating system is to only allow 64-bit applications to run. In order to run a 32-bit application under IIS you need to enable 32-bit support.

This can be done under the Advanced settings for the Application Pool under which your application is running.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-05-30 11:12
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.