Click here to Skip to main content
Click here to Skip to main content

SecondHit in IIS7

By , 20 Mar 2012
Rate this:
Please Sign up or sign in to vote.

As the continuation of first hit IIS 7 experience, learnt another interesting lesson on second hit of IIS 7.0

After the successful fix of the first issue (as mentioned in last blog), started browsing my service. Another hit! This time, got the error as:

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

Guess what! The error is due to the upgrade in development environment from 32-bit to 64 bit system. On opening the particular project, it has been discovered that the project configured to target x 86 platforms. As the application is running on 64-bit platform, it will have such ‘incorrect format’ error.

To fix it, perform the below steps:

· open project properties window.
· select Build tab
· Change it to ‘Any CPU’
· Save your changes.
· Compile your project and run Smile | :)

Another tip. Let us say you have a VS project that has the build configuration set to Any CPU but still getting the same error for an assembly. In that case, please make sure you have did so for all dependencies your website uses. You can also enable 32-bit mode on IIS and adjust your website and its dependencies to target x86 platform. Interesting technology hits on migrating to IIS 7.0

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

GanesanSenthilvel
Architect
India India
Currently working as IT Solution Architect for Financial Services applications. Out of 19+ years, worked few career years at USA, Europe and APAC. Basically from C, C++, VC++, C# family, extending to the emerging Big Data and Cloud technology. Weekly Tech inking at http://ganesansenthilvel.blogspot.com/ Loves driving, spending time with friends&family, blogging, grooming next Gen.
Follow on   Twitter   LinkedIn

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 20 Mar 2012
Article Copyright 2012 by GanesanSenthilvel
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid