Difference between platform and platform target in VS

10,534

Solution 1

The first screen shot is showing the solution configuration (Debug) and solution platform (Mixed Platforms). What this is saying is that building a Debug version of the solution, the projects that make up the solution can target Mixed Platforms. If you explicitly chose x86, that means all your projects in your solution should use this platform configuration. Configuration Manager under Tools provides you with means of selecting the Configuration and Platform solution wide, or for individual projects. The important thing to realize here, is that you're only selecting configuration, and it's the settings for the configuration that are defined else where, namely Project Properties (which brings us to the second screen shot).

The second screen shot is found in Project Properties in the build tab, and it is here where you can apply various settings for the combination of Configuration and Platform. So it's here where you can explicitly define what platform you want the build to target, given the configuration and platform marker. So it's possible for the Debug, Any CPU configuration to target x86 only.

This may not make much sense, and it's not very intuitive, but if you realize that you can define your own configuration values, then you have to some way specify the target platform for that configuration.

Solution 2

An important distinction here:

  • Platform can have any value. It is user-defined.
  • PlatformTarget must have a valid value of AnyCPU, x86, x64, ARM, ...
Share:
10,534
DotnetDude
Author by

DotnetDude

Updated on June 19, 2022

Comments

  • DotnetDude
    DotnetDude almost 2 years

    What's the difference between setting the platform -->

    alt text

    over setting the platform target in Build -->

    alt text