msbuild 语法_MSBuild 命令行参考

为文件记录器和分布式文件记录器指定任何额外参数。Specifies any extra parameters for the file logger and the distributed file logger. 若有此开关,表明存在对应的 -filelogger[number] 开关。The presence of this switch implies that the corresponding - filelogger[number] switch is present. Number 可以是 1 到 9 的数字。Number can be a digit from 1 to 9.

可使用针对 -consoleloggerparameters 列出的所有参数。You can use all parameters that are listed for -consoleloggerparameters. 还可以使用以下一个或多个参数:You can also use one or more of the following parameters:

- LogFile 。- LogFile. 写入生成日志的日志文件的路径。The path to the log file into which the build log is written. 分布式文件记录器将此路径用作其日志文件的名称的前缀。The distributed file logger prefixes this path to the names of its log files.

- Append 。- Append. 确定是将生成日志追加到日志文件还是覆盖它。Determines whether the build log is appended to the log file or overwrites it. 设置该开关时,生成日志将追加到日志文件。When you set the switch, the build log is appended to the log file. 此开关不存在时,将覆盖现有日志文件的内容。When the switch is not present, the contents of an existing log file are overwritten.

示例:msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.log;appendExample: msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.log;append

如果包含显式 true 或 false 设置,则无论设置如何,都将追加日志。If you include an explicit true or false setting, the log is appended regardless of the setting. 如果不包含追加开关,则会覆盖日志。If you do not include the append switch, the log is overwritten.

在此例中会覆盖文件:msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.logIn this case the file is overwritten: msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.log

在此例中会追加文件:msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.log;append=trueIn this case the file is appended: msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.log;append=true

在此例中会追加文件:msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.log;append=falseIn this case the file is appended: msbuild myfile.proj -flp:FileLogger,Microsoft.Build;logfile=MyLog.log;append=false

- Encoding 。- Encoding. 指定文件的编码(例如,UTF-8、Unicode 或 ASCII)。Specifies the encoding for the file (for example, UTF-8, Unicode, or ASCII).

下面的示例为警告和错误生成单独的日志文件:The following example generates separate log files for warnings and errors:

-flp1:logfile=errors.txt;errorsonly -flp2:logfile=warnings.txt;warningsonly

下面的示例演示其他可能性:The following examples show other possibilities:

-fileLoggerParameters:LogFile=MyLog.log;Append; Verbosity=diagnostic;Encoding=UTF-8

-flp:Summary;Verbosity=minimal;LogFile=msbuild.sum

-flp1:warningsonly;logfile=msbuild.wrn

-flp2:errorsonly;logfile=msbuild.err

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值