kick it on DotNetKicks.com   Shout it  

ASP.NET: System.BadImageFormatException

If you are running IIS 7 on Vista x64 you may get this error:

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

By default IIS 7 won't load x86 (32 bit) assemblies, make sure you set your application pool's “Enable 32-Bit Applications” setting to “True”.

Internet Information Services (IIS) Manager > Application Pools > {Your App Pool} > Advanced Settings > Enable 32-Bit Applications

If this still doesn't work. Try changing your build configuration platform setting for each project in your solution from “Any CPU” to “x86” and then rebuilding your solution.

Right-click Visual Studio Project File in Solution Explorer > Properties > Build > Platform

Tags: , , ,

kick it on DotNetKicks.com   Shout it  

Feedback

# re: ASP.NET: System.BadImageFormatException

Gravatar thank you. it works 10/30/2009 3:36 AM | barbarosbasaran

Post a comment





 

Please add 7 and 1 and type the answer here:

 

 

Copyright © Mark J. Miller