I converted an ASP.NET MVC web application to 64-bit in order to use dlib and it immediately died with a System.BadImageFormatException (Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format.)
Assuming I must have a stray wrong-bittedness something lying around I spent way to long with the assembly binding log viewer (Fuslogvw.exe) trying to figure out what I had messed up. But eventually I realized that Visual Studio was launching a 32-bit version of IIS Express to debug a 64-bit web application.
To fix this select Options from the Tools menu, expand Projects and Solutions, choose Web Projects and then check Use the 64-bit version of IIS Express for web sites and projects. Problem solved.
(Probably shouldn't have this component in the web application - the plan longer term is to move it to an asynchronous process somewhere instead.)
- XamlParseException and 256x256 icons
- Crushing PNGs in .NET
- CodePlex Shutdown: Shapefile, Orb, StackHash and Blogger2BlogML Migration
You Might Also Like
- Does America Need A Third Party (Again)
- Export Google Fit Daily Steps, Weight and Distance to a Google Sheet
- 1,000th Post!
(Published to the Fediverse as: BadImageFormatException for a 64-bit ASP MVC web application #code #asp.net #microsoft #32-bit #64-bit Visual Studio will try to use the 32-bit version of IIS Express to launch a 64-bit web application. Here's how to fix this problem by telling Visual Studio to use 64-bit IIS Express instead. )
really thanks for your precious help. your post is a life saver
That was a life saver! I would have never found that on my own. Thank you very much!