The difference when the platform option / is not specified for MSBuild

I have a VS10 project file (.csproj). I create this projcet using MSBuild from the command line. I have a simple question that I have been trying to find out since ancient times. What is the difference between these command line arguments: -

1. >MSBuild MyProg.csproj /p:Configuration="Release"
2. >MSBuild MyProg.csproj /p:Platform="AnyCPU" /p:Configuration="Release"   
3. >MSBuild MyProg.csproj /p:Platform="x86" /p:Configuration="Release"

In csproj file i have this PropertyGroup tag

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  <DebugSymbols>true</DebugSymbols>
  <DebugType>full</DebugType>
  <Optimize>false</Optimize>
  <OutputPath>..\..\bin\Debug\</OutputPath>
  <DefineConstants>DEBUG;TRACE</DefineConstants>
  <ErrorReport>prompt</ErrorReport>
  <WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  <DebugType>pdbonly</DebugType>
  <Optimize>true</Optimize>
  <OutputPath>..\..\bin\Release\</OutputPath>
  <DefineConstants>TRACE</DefineConstants>
  <ErrorReport>prompt</ErrorReport>
  <WarningLevel>4</WarningLevel>
</PropertyGroup>

I want to know what difference it makes when you specify the platform in command line arguments and when not. I tried to investigate this using the verbosity / v: d option on the command line, but I could not find any difference except that the platform for each assembly is different.

What will be the platform when I do not pass the platform on the command line? What happens when I pass x86 instead of AnyCPU?

thanks

+4
1

.csproj , :

<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

, $() , default, AnyCPU . , . , . :

, ?

, AnyCPU .

, x86 AnyCPU?

, x86.


, <Platform> #. ++, ++ , 32- 64- . / ARM Intel. #, , . - , .

, , - <PlatformTarget>. AnyCPU, . x86 EXE ( 32- VS2012 ), , 32- . , , AnyCPU x86 EXE.

, . , .

+10

All Articles