是否可以防止MSBuild打印色彩输出 [英] Is it possible to prevent MSBuild printing colourized output

查看:159
本文介绍了是否可以防止MSBuild打印色彩输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Windows shell配置为在白色背景上显示黑色文本。这使得几乎不可能读取默认msbuild输出由于非常苍白的颜色(特别是黄色警告)。

I've got my windows shell configured as displaying black text on a white background. This makes it almost impossible to read the default msbuild output due to the very pale colours (especially the yellow warnings).

因此,我想尝试以下之一

Therefore I'd like to try one of the following, but I can't work out if it is possible.


  1. 我想设置一个全局设置以永久关闭色彩输出在msbuild;或

  2. 如果(1)不可能,则可以使用命令行参数调用此输出。

推荐答案

有没有人知道如何执行上述其中一个? > MSBuild 4.0 可以使用 / consoleloggerparameters / clp 切换:

In MSBuild 4.0 this is possible using the /consoleloggerparameters or /clp switch:

msbuild C:\some_path\your.sln /clp:disableconsolecolor






或者,对于以前的MSBuild引擎,可以使用 PowerShell

外主机 将显示默认颜色:

Out-Host will display the default color:

Powershell -Command "msbuild C:\some_path\your.sln | out-host"

Write-Host 可让您自定义颜色:

Write-Host will let you customize the colors:

Powershell -Command "msbuild C:\some_path\your.sln | write-host -foreground "white""

这篇关于是否可以防止MSBuild打印色彩输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆