If you take a look the MSDN documentation for the reserved MSBuild Reserved Properties you will see many properties listed. For one reason or another there are actually several reserved properties that are missing from that list. Here is the list of all the reserved properties, the ones missing from that page are presented here in bold. For those that are listed on that page the description is taken from the MSDN. Also this is the list for MSBuild 3.5.

 

  • MSBuildNodeCount    
    • Contains the number of nodes, processes, which is being used to build the project.
  • MSBuildExtensionsPath32
    • Path to MSBuild extensions path specifically for the 32 bit directory. If you are using a 32 bit machine then this will be the same value as MSBuildExtensionsPath property.
    • This property can be overridden.
  • MSBuildProjectDirectoryNoRoot    
    • Same as MSBuildProjectDirectory but without the root listed in front.
  • MSBuildToolsPath    
    • Directory for the framework that is used to build the project.
  • MSBuildToolsVersion    
    • Tools version for the current build.
  • MSBuildBinPath    
    • The absolute path of the directory where the MSBuild binaries that are currently being used are located, for example, C:\Windows\Microsoft.Net\Framework\v2.0. This property is useful if you need to refer to files in the MSBuild directory.
  • MSBuildExtensionsPath    
    • The MSBuild folder under the Program Files directory. This location is a useful place to put custom target files. For example, your targets files could be installed at \Program Files\MSBuild\MyFiles\Northwind.targets and then imported in project files with the following XML.

      This property can be overridden.
  • MSBuildProjectDefaultTargets    
    • The complete list of targets specified in the DefaultTargets attribute of the Project element. For example, the following Project element would have an MSBuildDefaultTargets property value of A;B;C.
  • MSBuildProjectDirectory    
    • The absolute path of the directory where the project file is located, for example, C:\MyCompany\MyProduct.
  • MSBuildProjectExtension    
    • The file name extension of the project file, including the period, for example, .proj.
  • MSBuildProjectFile    
    • The complete file name of the project file, including the file name extension, for example, MyApp.proj.
  • MSBuildProjectFullPath    
    • The absolute path and complete file name of the project file, for example, C:\MyCompany\MyProduct\MyApp.proj.
  • MSBuildProjectName
    • The file name of the project file without the file name extension, for example, MyApp.
  • MSBuildStartupDirectory
    • The absolute path of the directory where MSBuild is invoked.

 

Take a look at this project file that prints out these values.

DefaultTargets="PrintProperties"
ToolsVersion="3.5">
















If you execute this you will get something like what's shown here.

 

I'm not sure how important this, but you may need to know one day.

ReservedProperties.proj

Sayed Ibrahim Hashimi


Comment Section


Comments are closed.