Monday, February 13, 2012

Solution Platforms and Configurations


Team Build deals with solution configurations - these are the platforms (e.g. .NET or Win32) and configurations (e.g. Debug or Release) you typically see in combo boxes within Visual Studio when you have a solution loaded (if you hover over these boxes the tooltips will say "Solution Platforms" and "Solution Configurations", respectively).

The Target Platform (C# Compiler Options) is an often overlooked option in the build configuration for Visual Studio projects. The list of available options are:

1. Any CPU
2. x86
3. x64
4. Mixed Platform

The meaning of these options is often misunderstood.  Based on their names, one might think that the compiler will generate code differently based upon the setting.  However, the C# compilers only generate IL code that is taken to native code by the CLR at runtime using the just-in-time compiler. The fact is that this setting actually does not affect the build of the assembly in any way except to set the platform status information on the assembly’s CLR header. In other words, the Platform Target setting is meant to communicate the platform that the developer intends to be compatible with.

When all of the projects in a solution are of the same type (e.g. C#) the solution configurations will match up exactly with the project configurations. Once you have projects in a solution that have mismatched configurations/platforms, Visual Studio creates the solution level configuration(s) "Mixed Platforms/Debug" and possibly "Mixed Platforms/Release".  These configurations are just mappings to individual project level configurations.

This is just an excerpt from the complete article here which explains further in detailshttp://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/




2 comments:

  1. Nice summary -- thanks for posting this information.

    ReplyDelete