Common Error: System.BadImageFormatException: Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format.

System.BadImageFormatException: Could not load file or assembly  or one of its dependencies. An attempt was made to load a program with an incorrect format.

 

The above error occurs after you set a project ( a web project or one its dependencies) to target x64 .

The fix is simple, but difficult to find. Select your web project, click ‘Tools | Options ‘, then Select ‘Projects And Solutions | Web Projects’ and then check the box for ‘Use the 64 bit version of IIS Express for web sites and projects’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s