A program with an incorrect format

Server Error in '/Web.Api' Application.
Could not load file or assembly 'Oracle.ManagedDataAccessDTC' 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 ‘Oracle.ManagedDataAccessDTC’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

In my case this isn’t really an issue with the Oracle dependencies. The key here is the An attempt was made to load a program with an incorrect format part. The problem occurs on my local Windows 10 (x86_64) machine with IIS 10. And yes, the project builds for 32 bit, not 64 bit. Setting “Enable 32-bit applications” in the “Advanced settings…” of the web site (“Default Web Site” in my case), in the “Application Pools” solves the problem.

Leave a Reply

Your email address will not be published. Required fields are marked *