views:

13

answers:

3

The Obsolete attribute, and a few other things I've seen are able to have custom warnings or messages show in the Visual Studio IDE Error window. Is this possible with a custom attribute, preprocessor directive in C# or something else?

using Reflector to look at the Obsolete attribute didn't have any clues.

A: 

You can use the System.Diagnostics namespace.

And then call Debug.WriteLine("Some text ");

http://support.microsoft.com/kb/815788

nportelli
no, I mean the Error/Warning/Information window that's updating without running the project.
Maslow
A: 

#warning DEBUG is defined - link

works for warnings

Maslow
A: 

This may not be exactly what you're looking for. But I use

// TODO: Blah.

That will put a todo item in your task list (not the output window) without running the solution.

Zippit
yeah, but that's in a separate window, that you have to change a drop down to comments manually and remember to check instead of in the error window you look at every compile anyway.
Maslow