Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

Published on September 8, 2016 by abundantcode

Filed under ASP.NET

Last modified September 8, 2016

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 3917 times

There are times when you might get the following error when running the application from Visual Studio or opening your application page in the browser.

Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

I received this error recently when trying to deploy the application in the IIS and accessing the page from the browser.

One of the primary reason that you might get this error could be the 32-bit and 64-bit dll support. If you are receiving this error on deployment , ensure that your Application pool is set to support 32-bit libraries in IIS.

Leave a Comment


x

You might be Interested in these Posts

How to read connection string from web.config in ASP.NET and C# ?

Here's a sample code snippet demonstrating how to get the connection string from your ASP.NET web.co...

How to return Json instead of XML in ASP.NET Web API ?

When you make a call to the ASP.NET Web API action method and notice this in Google Chrome browser ,...

How to Add Web API to existing ASP.NET Web Forms Project ?

In one of the previous posts , we saw how to add the WebAPI to the existing ASP.NET MVC project. Wel...