O'Reilly logo

Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build by William Bartholomew, Sayed Ibrahim Hashimi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Properties and Targets

MSBuild properties are simply key-value pairs. The key for the property is the name that you will use to refer to the property. The value is its value. When you declare static properties, they are always contained in a PropertyGroup element, which occurs directly within the Project element. We will discuss dynamic properties, those declared and generated dynamically inside targets, in the next chapter. The following snippet is a simple example of declaring static properties:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <AppServer>\\sayedApp</AppServer>
    <WebServer>\\sayedWeb</WebServer>
  </PropertyGroup>
</Project>

As previously stated, the PropertyGroup element, inside the Project element, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required