Little JOhnny
Little JOhnny

Reputation: 181

32 and 64 bit ASP.NET deployments

Is the ASP.NET/C# code I develop inherently 32/64 bit agnostic, because it's compiled to some sort of intermediate language? The reason I ask is that I compile my ASP.NET app on an x64 laptop and then deploy on an x32 server. There are no problems. Further, I see no options for selecting between a 32 and 64 bit build in VS2010.

Upvotes: 4

Views: 273

Answers (2)

citronas
citronas

Reputation: 19365

There are some 3rd party libraries that can only run as x86.

The best approach would be to have your local environment (local IIS) to match the settings of your target webserver as much as possible. So if your target IIS only runs as 32 bit, set the "force 32 bit" property of the applicationpool on your local IIS to true.

Upvotes: 0

Mikael Svenson
Mikael Svenson

Reputation: 39695

You can compile your code to

  • AnyCPU - executed in 32bit on a 32bit runtime and 64bit on a 64bit runtime
  • x86 - forced to execute in 32bit
  • x64 - forced to execute in 64bit (will not work on 32bit OS)
  • (IA64 - Itanumim)

If you compile for AnyCPU you are in good shape, and more often than not, you will use the AnyCPU platform target. (Build -> Configuration Manager in Visual Studio)

When compiling .Net code it's compiled into Intermediate Language code (MSIL) which in turn is compiled to native code at runtime by the .Net framework/runtime.

Upvotes: 4

Related Questions