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

Scenario : 

I have assemblies in my mail solution (.net 4.0) from different versions (32 bit) . I have already set “Any CPU” in my VS 2010 project and everything works fine until i deploy it on IIS . 

Look here how to set your project to “Any CPU”

 

I get “Could not load file or assembly ‘XXXXX’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” error…

 

Fix:

–> Go to IIS manager  admin  window

–> Go to properties of application pool selected for your application

–> Click on default properties of application pool 

–> set “Enable-32 bit applications” to True.

 

Run your application now 🙂

 

 

 

 

Advertisements

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

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