我已将以下任务添加到我的项目中:
<Target Name="Foo" AfterTargets="Build">
<Message Importance="high" Text="Some text." />
</Target>
消息出现在 Output 窗口中,但不在 Error List 窗口中。
有办法做到吗?
我检查了其他涉及错误列表的问题,我不太乐观。
您可以将 警告任务 添加到您的项目中。
这是一个例子:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="ValidateCommandLine">
<Warning
Text=" The 0 property was not set on the command line."
Condition="'$(0)' == ''" />
<Warning
Text=" The FREEBUILD property was not set on the command line."
Condition="'$(FREEBUILD)' == ''" />
</Target>
...
请注意,警告任务只能在构建过程之前执行。