Compile ASP.NET to 64 BIT

asp.net

My development machine is Win XP Pro 32 bit and production machine is Windows Server 2008 (64 Bit) with IIS 7. On my development machine I want to compile ASP.NET (Using aspnet compiler) to 64 bit byte code.

Can anyone please tell me how to do that? Please do not suggest any way to run 32 bit application on 64 bit environment.

I want 64 bit application to be compiled on 32 bit machine so that when it runs it will take full advantage of 64 bit O/S without any emulation.

Best Answer

Leave the target platform at AnyCpu and .NET will automatically run natively on 64bit when executed on a 64Bit operating system

Clarification:

(this started out as a comment but I thought it might be interesting for the question as well)

Actually you never compile to a special architecture. You always compile to IL.

That's something like Java Bytecode. And that bytecode is the same for 32 bit and 64 bit.

The Virtual Machine (.NET Framework) on the machine the code gets executed then compiles the IL to actual machine code while running (through the Just In Time compilation). So, no matter where you compile, you'll always end up in IL that's bit-ignorant.

The setting in .NET is only an instruction in IL that tells the JIT (Just in Time compiler) to specifically use 32bit/64 bit. By flipping that one bit in your assembly you could still execute it in AnyCpu or x64 without recompilation.

This setting is only used and needed in case you call out to native code that isn't bit-ignorant (when interacting with COM components or doing p/invoke calls)