tags:

views:

1417

answers:

4

Hi there,

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.

Thanks in advance

+4  A: 

.net apps will re-target themselves for the target machine environment assuming that you didn't specifically choose to compile in 32-bit mode. This can be found under the project build options.

Kevin
Correct, just be sure you're not optimizing for a specific architecture and you should be all set.
Chris Ballance
+9  A: 

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)

greeetings, Daniel

Tigraine
I am compiling ASP.NET (File system mode and not web application project) through aspnet_compiler (Only .NET 2.0 32 bit is installed and hence using 32 bit framework). What I understood is that if I copy all the dlls which are under \bin to my production machine it will fully run in 64 bit mode without any emulation. I just wanted to confirm that there should not be any performance issue when application is compiled on 32 bit machine and ran on 64 bit. Since I do not have web application project then in that case will aspnet_compiler compile to AnyCPU mode??. Thanks in advance
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. So, no matter where you compile, you'll always end up in IL.The setting in .NET is only an instruction in IL that tells the JIT (Just in Time compiler) to specifically use 32bit/64 bit in case you call out to native code that isn't bit-ignorant.So, actually you always run in emulation :D
Tigraine
A: 

Mr Tigraine, That is not true as u explained. In .NET u can compile to AnyCPU/x86/x64 as target. If I compile to x64 target, it will not run on 32 bit plateform. So IL instructions are controlled by how u compile. My question is still not answered. I just asked, if I compile with aspnet_compiler on 32 bit WinXP machine, will there be any problem on running on 64 Bit 2008 server. What default target aspnet_compiler uses during compilation AnyCPU/x84 or x64 ?? If it uses AnyCPU then there will be no problem. That is what I just want to confirm?

A: 

There is no project file when I do compilation with aspnet_compiler [There is for Win form and consol app]. I am not using web application project file. it is just set of files in my web site without any project settings file. I compile through aspnet_compiler at command line and I have no idea where I can find the option to control the target compilation option.