Search notes:

MSBuild: command line option -property

The MSBuild command line option -property allows to define property values. -property can be abbreviated with -p.
This can be demonstrated in the following simple project file that contains one only target. This target prints the values of the properties foo, bar and baz:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

   <Target Name="Print property values">
       <Message Text="foo = $(foo)"/>
       <Message Text="bar = $(bar)"/>
       <Message Text="baz = $(baz)"/>
   </Target>

</Project>
Github repository about-MSBuild, path: /command-line-options/property/proj.csproj
This project file might be invoked from the command line like so:
P:\ath\to\project\file:> msbuild -property:foo=theFoo
P:\ath\to\project\file:> msbuild -property:foo=theFoo            -property:baz=theBaz
P:\ath\to\project\file:> msbuild -property:foo=theFoo,bar=theBar -property:baz=theBaz

Index