MSBuild

https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference

查看版本

PS C:\Program Files\PowerShell\6.0.0-beta.6> msbuild /version
Microsoft (R) Build Engine version 4.6.1590.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

4.6.1590.0

 

PS C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin> .\MSBuild.exe /version
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

15.3.409.57025

/target:targets /t:targets

Build the specified targets in the project. Specify each target separately, or use a semicolon or comma to separate multiple targets, as the following example shows:

/target:Resources;Compile

If you specify any targets by using this switch, they are run instead of any targets in the DefaultTargets attribute in the project file. For more information, see Target build orderand How to: Specify which target to build first.

A target is a group of tasks. For more information, see Targets.

 

/property:name=value /p:name=value

Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows:

/property:WarningLevel=2;OutDir=bin\Debug 

 

/nologo 

Don't display the startup banner or the copyright message.

 

 

/verbosity:level

Specifies the amount of information to display in the build log. Each logger displays events based on the verbosity level that you set for that logger.

You can specify the following verbosity levels: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

The following setting is an example: /verbosity:quiet

 

/consoleloggerparameters:   /clp: 

Pass the parameters that you specify to the console logger, which displays build information in the console window.

You can specify the following parameters:

ErrorsOnly. Show only errors.

 

/maxcpucount[:number]   /m[:number]

Specifies the maximum number of concurrent processes to use when building.

If you don't include this switch, the default value is 1.

If you include this switch without specifying a value, MSBuild will use up to the number of processors in the computer.

For more information, see Building Multiple Projects in Parallel.

The following example instructs MSBuild to build using three MSBuild processes, which allows three projects to build at the same time:

msbuild myproject.proj /maxcpucount:3

 

 

 

切换路径

cd 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\'

 

PS C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin> .\MSBuild.exe /version
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

15.3.409.57025

posted @ 2017-09-21 10:45  ChuckLu  阅读(376)  评论(0编辑  收藏  举报