views:

482

answers:

2

Edit: I reported this as a bug on the Microsoft Connect site here.

Edit 2: Microsoft will not fix this bug (at least not in VS2010).

User defined warnings are only shown in the Error List window for one file per project. So if you put the #warning directive in several files of your project, you will not see any warnings after build for most of the files. The missing warnings are generated by msbuild and can be seen in the Output window, but not in the Error List window.

Note: none of the files containing #warning's must be open in VS editor on the moment of build for this effect (a VS bug?) to be seen.

How do I get all of my user-defined warnings displayed on build?

I'm using Visual Studio 2008 SP1.

A: 

I did a little experiment of my own.

  • Created a C# console application and added a second file
  • Added #warning file1 and #warning file2 (one per file)
  • Rebuild all

In this case the task list only shows one of the errors. However if you look at the output window it shows both errors while compiling.

The displaying of only one error in the task list smells like a bug. Could you please file this issue on connect?

JaredPar
Thanks for the suggestion, I did so.https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=470753
Gebb
A: 

You haven't said what you're trying to accomplish, only how you're trying to accomplish it.

Still, see if Error message highlighting in source code helps you out any.

John Saunders
Well, I tried to mark some pieces of code as dangerous and thus needed to be rewritten ASAP.
Gebb