如何添加到邮件列表在Visual Studio错误列表窗口? [英] How do I add to the MESSAGES list in the Visual Studio Error List window?

查看:187
本文介绍了如何添加到邮件列表在Visual Studio错误列表窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#ERROR显示错误,警告指令#warning。 ?怎样才能让一行文字出现在错误列表窗口的邮件过滤器

#error shows in errors, #warning in warnings. How can I make a line of text appear in the messages filter of the Error List window?

要澄清:

如果我把一个C#代码文件中的以下行,它会产生上构建一个错误,将出现在错误列表窗口的错误,如果我打开(的错误,如列表上方的标签,有按钮可以切换的错误警告的消息的)。

If I place the following line within a C# code file, it will generate an error on build, and that error will appear in the Error List window if I switch the errors on (like tabs above the list, there are buttons to toggle Errors, Warnings, and Messages).

#error This will cause a divide by zero

同样可以做到注入到警告生成输出:

The same can be done to inject warnings into the build output:

#warning This might produce a NullReference exception

我将在C#代码文件放到什么有一个这样的消息出现在的消息列表?

What would I place in the C# code file to have a message like that appear in the Messages list?

推荐答案

简短的回答:你不能

如果您希望与建筑商沟通你的代码,因为这些出现在所有版本,而不仅仅是在Visual Studio中使用警告或错误。

If you want to communicate with the builder of your code, use warnings or errors as these appear in all builds, not just in Visual Studio.

这篇关于如何添加到邮件列表在Visual Studio错误列表窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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