MSBuild Command Line Reference

MSBuild.exe builds the specified project or solution file with the specified options.

MSBuild.exe [Switches] [ProjectFile]


Argument Description


Builds the specified targets in the project file. If a project file is not specified, MSBuild searches the current working directory for a file name extension that ends in "proj" and uses that file. This argument also accepts Visual Studio 2005 solution files.


Switch Description


Displays usage information. /? or /h are also acceptable.

Msbuild.exe /?


Hide the startup banner and copyright message.


Display version information only. /ver is also acceptable.


Insert command line settings from a text file. Specify each response file separately. For more information, see MSBuild Response Files.


Do not auto-include the MSBuild.rsp file. /noautorsp is also acceptable.


Build these targets in this project. Use a semicolon or a comma to separate multiple targets, or specify each target separately. /t is also acceptable. For example:



Set or override these project-level properties, where name is the property name and value is the property value. Use a semicolon or a comma to separate multiple properties, or specify each property separately. /p is also acceptable. For example:



Specifies the logger to use to log events from MSBuild. To specify multiple loggers, specify each logger separately.

The logger syntax is:

[ LoggerClass ,] LoggerAssembly [; LoggerParameters ]

The LoggerClass syntax is:

[ PartialOrFullNamespace .] LoggerClassName


You do not need to specify the logger class if there is exactly one logger in the assembly.

The LoggerAssembly syntax is:

{ AssemblyName [, StrongName ] | AssemblyFile }

Logger parameters are optional and are passed to the logger exactly as you type them. For example:



Specifies the parameters to pass to the console logger. /clp is also acceptable. The available parameters are:

  • PerformanceSummary: Displays the amount of time spent in tasks, targets, and projects.

  • NoSummary: Hides the error and warning summary displayed at the end of a build.

  • NoItemAndPropertyList: Hides the list of items and properties displayed at the beginning of each project build in diagnostic verbosity.


Display this amount of information in the build log. Individual loggers choose what events to show at a particular verbosity level. A logger may also choose to ignore the verbosity setting.

The available verbosity levels are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. /v is also acceptable. For example:



Disable the default console logger and do not log events to the console. /noconlog is also acceptable.


Validates the project file, and, if successful, builds the project.

If schema is not specified, validates the project against the default schema.

If schema is specified, validates the project against the specified schema.


To pass parameters to the default console logger, disable it with /noconsolelogger and then specify it with the /logger syntax. For example, use the following command line to show the performance summary normally only displayed in diagnostic verbosity:

msbuild myproject.csproj /noconsolelogger /l:ConsoleLogger,Microsoft.Build.Engine.dll;performancesummary


The following example builds the rebuild target of the MyProject.proj project.

MSBuild.exe MyProject.proj /t:rebuild

You can use MSBuild.exe to perform more complicated builds. For example, you can use it to build specific targets of specific projects in a solution. The following example rebuilds the project NotInSolutionFolder, and cleans the project InSolutionFolder, which is in the NewFolder solution folder.

msbuild SlnFolders.sln /t:NotInSlnfolder:Rebuild;NewFolder\InSolutionFolder:Clean

See Also

Other Resources

MSBuild Reference