Click here to Skip to main content
15,881,173 members
Articles / All Topics

SecondHit in IIS7

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
20 Mar 2012CPOL1 min read 6.6K   2  
Another interesting lesson on second hit of IIS 7.0

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

After the successful fix of the first issue (as mentioned in last blog), I started browsing my service. Another hit! This time, I 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 :)

Another tip. Let us say you have a VS project that has the build configuration set to Any CPU but you are still getting the same error for an assembly. In that case, please make sure you have done 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)


Written By
Architect
India India
Ganesan Senthilvel is a passionate IT leader with demonstrated 2 decades’ experience in architecture, design and implementing cutting edge solutions to address business opportunities of Enterprise applications. He earned Masters in Computer Science and Master in Business Administration. Now, he is pursing Doctorate program in Big Data. He is consistent technical contributor via COE, Blog, Whitepaper, Summit, Certification, etc. and also highly skilled at providing coaching and mentoring to internal teams and external institutes. Earned Microsoft Certifications like MCP, MCAD and financial domain certification.
He maintains his weekly blog at http://ganesansenthilvel.blogspot.in

Comments and Discussions

 
-- There are no messages in this forum --