1

We could use msbuild to build project from command line. My question is about -p option. This option is used to specify property key/value pairs. My question is, besides the key/value pair assigned by -p option from command line, any other already existing defined options? If there are such existing defined options, where are the existing options defined and how such key/value pairs are used during build process?

For example, command like msbuild foo.sln /p:Configuration=Debug, besides option Configuration (whose value is Debug), are there any already defined existing options?

thanks in advance, George

BIBD
  • 15,107
  • 25
  • 85
  • 137
George2
  • 44,761
  • 110
  • 317
  • 455

2 Answers2

2

See MSBuild Reserved Properties and How To: Use Environment Variables in a Build, since these are kinda properties too.

Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
  • @Anton, I take some time to learn from your recomended documents. Two more questions, 1. how to list all the current property key/value pairs? 2. (about your recommended 2nd document) my question is about how to use property, but how to use environment variable in msbuild. 3. Could you recommend me some dedicated books for msbuild or similar topics? – George2 Apr 28 '09 at 03:51
0

The properties will vary from project type to project type but here a list of typical ones for .NET projects with example values:

  • Configuration: Debug, Release
  • Platform: x86, x64, Any CPU
  • Optimize: true, false
  • OutputPath: bin\Debug\, bin\Release\
  • NoWarn: 1591 (suppress missing XML documentation warning)

To see all the other properties used during a build you can open up the common MSBuild targets located in the Framework directory: C:\Windows\Microsoft.NET\Framework\v4.0.30319. Check out Microsoft.Common.targets and Microsoft.CSharp.targets for C# project build properties.

If you want in-depth coverage of MSBuild I recommend reading Inside the Microsoft Build Engine or MSBuild Trickery. If you already know the basics though I would skip the first book. You can get basic tutorials for MSBuild online.

Community
  • 1
  • 1
Scott Lerch
  • 2,620
  • 1
  • 23
  • 34