c# - 自定义 MSBuild 任务发出警告

标签 c# msbuild

如何让自定义构建任务发出警告?

最佳答案

您必须派生的任务有一个成员:

public Microsoft.Build.Utilities.TaskLoggingHelper Log { get; }

要使您的任务发出消息,请使用它。具体来说:

public void LogWarning(string message, params object[] messageArgs)
    Member of Microsoft.Build.Utilities.TaskLoggingHelper

例如:

Log.LogWarning("My Warning");

关于c# - 自定义 MSBuild 任务发出警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12745010/

相关文章:

msbuild - 错误 RG0000 : Could not load file or assembly 'xxx' or one of its dependencies. 访问被拒绝

node.js - Windows 7 上的 Node 故障

msbuild - 在 Azure Project 上缩小并包含 js 和 css 文件

c# - 向 datagridView 中的某些单元格添加按钮

c# - 为什么这些 Timer 事件会在不一致的时间引发?

c# - 仅包含接口(interface)的 WinRT 组件 DLL?

TFS增量构建错误-无法执行获取操作,因为文件已存在于本地

.net - 如何摆脱 msbuild 警告 MSB3644

c# - 删除尾随零

c# - Linq 联盟 : How to add a literal value to the query?