Visual Studio .NET Tips & Tricks

Helpful information for Visual Studio .NET developers

Tip: Treat Warnings as Errors

Posted by Ion Toma on April 16, 2006

A warning is a bug in waiting*. Warnings may be acceptable for debug builds, but for a release build, warnings must be always treated as errors. Zero-warnings should be as a rule for programmers, it is easy to ignore warnings, some of them may actually indicate a problem.
Warnings are the compiler's way of saying "this bit of code looks wrong, you better check it out“*. 

Others reasons:

  • It is bad practice to ship code that has compiler warnings in it. The compiler can help the developer, if the compiler generates an warning that means the developer must pay attention to it.
  • The customer may get some examples which contains sources. The warnings generated during compilation make the code look sloppy.

How to set it up: from Project Settings> Configuration Properties select the build setting and change the “treat warnings as errors” settings to true.Then set the warning levels to full, since we want to get all the help from the compiler as possible.

Warnings - Image 3



Posted in Coding & Debugging, Intermediate, Miscellaneous, VS.NET 2003, VS.NET 2005 | 2 Comments »

Tip: Custom Tasks List

Posted by Ion Toma on April 16, 2006

Custom task list is a great feature, which provides information about errors, annotations that a developer will leave in code.

Custom Task List - Image 1

There are some default tokens built-in in VS.NET. Example: TODO tokens (to finish some piece of code, etc).
The developer can create custom tokens for bugs, for notes that he/she want to leave to other developers on team that may work on the same code.

 – Go to  Options, select Task List, then enter a name for the CUSTOM TOKEN and click Add.

Custom Taks List - Image 2

Flash Demonstration

Posted in Coding & Debugging, Intermediate, VS.NET 2003, VS.NET 2005 | Leave a Comment »