Skip to contentSkip to author details

IIS Error Message - An attempt was made to load a program with an incorrect format.

 32-Bit  64-Bit  ASP.NET  IIS

If you receive the following error message when running a website (usually after deploying onto a 64-bit machine):

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

It could indicate that your web app (or one of its dependencies) was built for x86 and 32-bit applications are turned off in your application pool.

  1. Open IIS Administration Tool
  2. Click on sites
  3. Click on the site you’re trying to run
  4. On the right side, click on “Advanced Settings”
  5. A dialog box pops up with information about the site in it
  6. Look for the name of the Application Pool
  7. Close this window
  8. Click on “Application Pools” in the tree on the left
  9. Click on the Application Pool from the screen you just looked at
  10. Click on “Advanced Settings” on the right
  11. Look at the value for “Enable 32-Bit Applications”
  12. Make sure this is set to True (it is False by default)

You could also recompile your project for x64, but any dependencies you have might not work.