I began developing this project on another computer in "Any Cpu" mode. Then after a while, I added a x64 C++CLI project reference to it and the only way it would not give me the "bad image" exception was when I switched the asp project to x64 too.
Even then it was giving me errors on build, every now and then it would complain about msbuild.exe being inaccessible but I think this problem is unrelated (msbuild.exe's were just piling up in task manager).
Anyways, I now migrated the project to another computer and its refusing to build it in x64 mode no matter what. I get the
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.BadImageFormatException: Could not load file or assembly 'ProjectName' or one of its dependencies. An attempt was made to load a program with an incorrect format.
With no useful detail at all. I tried removing all its references but still, as long as its in x64, it wont run, runs fine in "Any Cpu" mode but this won't work with the library I'm using. Also it works fine when just deployed in my IIS server.
Does anybody have a clue about whats going on?
EDIT: I found my answer here: https://stackoverflow.com/a/23867475/4049658
This can't be normal though, right? Why do people have to go modifying the registry just to get to debug in x64?