1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

Windows x64 and the Microsoft .NET Framework: 32-bit or 64-bit?

Discussão em 'Programação' iniciada por RavenMaster, 24 de Março de 2005. (Respostas: 1; Visualizações: 1284)

  1. RavenMaster

    RavenMaster Power Member

    "The Microsoft .NET Framework is the core “runtime” and libraries for all Microsoft .NET applications. On Windows x64, the Microsoft .NET Framework v1.1 will run as a 32-bit application – not as a 64-bit application. In the next release of .NET, the installer will install a native x64 version of the .NET framework, along with a 32-bit version (yes, TWO identical .NET Frameworks – one x64 and one 32-bit). To understand why Microsoft is doing this, let me explain how .NET applications really “work”.

    When a developer is finished writing his application, he uses a .NET enabled compiler to compile his code into a .NET assembly (usually into a .exe or a .dll file). A .NET Assembly does not contain any architectural “machine” code, it contains “MSIL” – Microsoft Intermediate Language. When you run a .NET assembly, the .NET “CLR” – Common Language Runtime reads the MSIL and converts it into code that your architecture can understand.

    With this in mind, why doesn’t .NET 1.1 run assemblies as an 64-bit process on Windows x64? The quickest answer would be, .NET 1.1 simply does not have any type of x64 support. So why not make a patch, or release an update to .NET 1.1 to make it support running 64-bit assemblies?

    The answer is compatibility. In .NET, a developer can still use COM controls and make Win32 calls in their assemblies. A 64-bit application can’t host 32-Bit COM controls, and if you ran an assembly in 64-bit mode – it would have a problem if it made a 32-bit specific call.

    In the next release of .NET, .NET 2.0, Microsoft will include x64 binaries and 32-bit binaries in the x64 setup. Microsoft also has added a new setting to the various .NET Compilers which determines which architecture you want your assembly to target – 32-bit, x64, IA64 (Itanium), or “anycpu”. If a developer specifies 32-bit, the application will run as a 32-bit application on Windows x64. If the architecture is set to “anycpu”, it will run on any .NET supported platform (providing it doesn’t use any architecturally specific calls).

    The last important thing to note about .NET on x64 is specifically about ASP.NET on Windows x64’s IIS6 (even XP Professional x64 has IIS6). Since IIS6 is 64-bit, normally .NET 1.1 (being 32-bit) wouldn’t run with it. However, if you run the following command in Command Prompt, you will be able to use .NET 1.1 ASP.NET in x64’s IIS6 (which runs in 32-bit mode):

    cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1

    Unscientifically, my ASP.NET applications running on the .NET 1.1 framework in 32-bit mode on Windows x64 show a speed increase. Not leaps and bounds faster, but I’ve noticed a quicker response from the server, and quicker rendering pages to the client.

    The bottom line: .NET 1.1 will run fine on Windows x64 – as a 32-bit application. "

  2. NoMercy

    NoMercy Power Member

    Fixe, boa noticia :)

Partilhar esta Página