Setting IIS Express to run 64 bit mode

Trying to debug my web application in VS, and I get the following errors.

<pre>Could not load file or assembly [your assembly name here] or one of its dependencies. An attempt was made to load a program with an incorrect format.</pre>

 

I’m using IIS Express for debugging, so the fix for me was to make sure that IIS Express will run in 64 bit mode. To do this

  1. Select your solution
  2. Click Tool | Options |
  3. Expand Projects and Solutions, and select ‘Web Projects’
  4. Check the box for ‘Use the 64 bit version of IIS Express for web sites and projects’
  5. Click OK
  6. Run it again