Wednesday, July 28, 2010

.NET Consideration for x64 CPU Architecture

Running in both 64 bit and 32 bit Architectures
If you have an assembly built with the Any CPU target platform in Visual Studio then when the application runs in 64 bit process it would run as a 64 bit image like wise if it runs in a 32 bit process it runs as a 32 bit image.

Loading assemblies
If you have an assembly build as x86 target platform a 64 bit process can still load this assembly but the contrary is not true if you have built an assembly in x64 platform this assembly can't be loaded in a 32 bit process

Having both 64 bit and 32 bit build target platform
If you have some projects that target 32 bit platform and other projects that target 64 bit in Visual studio, if you have your target platform as Any CPU, the projects with x86 would not be built and would be skipped.

The same holds for any specific targets for projects within a solution.

In order to build Any CPU, x64 and x86 target platforms in one go you would need to create a new configuration for mixed mode and change individual projects to their required CPU architectures.

If you have an assembly and would like to find out which target platform it was built then use the corflags.exe tool that comes with .NET Framework SDK

No comments:

Post a Comment