How to add MESSAGES to the list in the Visual Studio error list window?

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

To clarify:

If I put the following line in a C # code file, it will create an error during assembly, and this error will appear in the error list window if I turn on errors (for example, tabs above the list, there are buttons for switching errors, warnings and messages).

#error This will cause a divide by zero 

The same can be done to enter warnings in the output of the assembly:

 #warning This might produce a NullReference exception 

What would I put in a C # code file so that such a message appears in the message list?

+7
c # visual-studio
source share
5 answers

Short answer: you cannot.

If you want to communicate with the developer of your code, use warnings or errors, because they are displayed in all assemblies, and not just in Visual Studio.

+3
source share

You can use TasksList. From the View menu, select Other Windows and click Task List. A list of tasks is displayed. In the Categories list, click Comments. The comment text is displayed in the comment list and appears there when you open and edit the code file. You can click any comment in the task list to activate the file in the code editor and go to the line of code that is marked with the comment. You can use // TODO, // HACK, // UNDONE or user comments.

+4
source share

I think this is what you are looking for: http://www.mztools.com/articles/2008/MZ2008022.aspx

I settled on this question because I was looking to do the same from my AddIn, written in C # for Visual Studio 2010.

After a couple of minutes I finally got the answer in this link!

+2
source share

Not sure what you are asking? Mostly you want to see these errors and warnings?

It may sound very simple, but: 1) Make sure that your list of errors is displayed completely, making the window larger, so you see the headings "Description", "File", "Line" ... 2) Click the "Errors" and " #Warnings "at the top.

0
source share

We tend to do what the orolog suggested. We defined our own INFO tag so we can put // INFO This is a message.

It would be nice to find a way to generate an informational message.

0
source share

All Articles