Documenting has never been so easy

Helixoft Blog

Peter Macej - lead developer of VSdocman - talks about Visual Studio tips and automation

VS 2005 generates many types of compile warnings. The most annoying ones are those underlined directly in the source code (all in VB .NET). We cannot get rid of all warnings. For example, our VSdocman allows XML comments also for namespaces. VS doesn't like this and gives the following warning:

XML comment block cannot be associated with any language element that supports the application of XML documentation comments. XML comment will be ignored.

In VB .NET, when we go to project Properties - Compile tab, we can change the behaviour of some warnings. We can set the notification to Error, Warning or None. But we can change only limited set of warnings. So how can we set our custom warning?

It's quite easy in C#. We can enter comma delimited list of warning IDs in project Properties - Build tab, Errors and warnings section. In VB .NET, we must use small trick described later.

And how can we get the ID for specific kind of warning? This information is not present in Error list window. We must open Output window and build the project. Warnings use the full format including the ID in output window. In our case we get:

BC42312: XML comment block cannot be associated with any language element that supports the application of XML documentation comments. XML comment will be ignored.

The ID is just numeric part, in our case 42312. As already mentioned, we can directly enter this value in project properties window in C#.

For VB .NET we need to manually edit project .vbproj file.

  1. Close VS.
  2. Open .vbproj file. Find tag and add the ID there. In our case it may look like 42312. Don't place any whitespaces and newlines in this tag! There is one section for each configuration (Release/Debug) so you need to edit all of them.
  3. Save the .vbproj file and open VS.

After this, you shouldn't get specified warnings during the build nor should you see warning underline during editing.

 

Start generating your .NET documentation now!

DOWNLOAD

Free, fully functional trial

Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Quantcast
Accept
Decline