64 bit C# .net app is not working in my 64 bit Win server 2012 (Virtual machine). As per my understanding 64 bit OS will support both 32 bit and 64 bit processes. When I set my web app target to x64 I'm getting a bad image exception. Ideally 64 bit OS should run the .net app under 64 bit process unless it is explicitly set to run under 32. But in my case, it is not working that way it seems. Am I missing something here? Search for an answer did not help me. Could some one please shed some light on this? The application is a very basic test app with a button and a label only where I'm trying to check running the app with x86,x64 and ANYCPU.
BTW, when I create a new windows app, it runs successfully even with x64.