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.
- Open IIS Administration Tool
- Click on sites
- Click on the site you’re trying to run
- On the right side, click on “Advanced Settings”
- A dialog box pops up with information about the site in it
- Look for the name of the Application Pool
- Close this window
- Click on “Application Pools” in the tree on the left
- Click on the Application Pool from the screen you just looked at
- Click on “Advanced Settings” on the right
- Look at the value for “Enable 32-Bit Applications”
- 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.