I heard that we have to build with the highhest warning level.
Is it true? why?
And how to change default .NET warning level?
migrated from stackoverflow.com Jun 6 '11 at 9:00
This question came from our site for professional and enthusiast programmers.
You don't have to, but it is a good idea to build with the highest warning level. Why? Warnings are potential problems with your code - things you might have done wrong, badly or in a way that is likely to cause problems.
Turning on the warnings at the highest level will highlight these problems, allowing you to fix them early, rather than let them become potential bugs at a later date. Plus, you'll learn good programming practice as you compile - improving your coding as you go.
Edit: In Visual Studio 2010, you can change the warning level for a project by right-clicking on it, going to its properties page and then setting warning level to 4 on its Build tab. If you also tick 'Warnings as errors', any warnings will break your build - so you'll have to fix them.
It helps you ensure you check all of the warnings.
These warnings may be change in the future version (for instance, their namespace may be change)
Also this maybe face you with an issue in a specific field.
You have to know all of your application warning and resolve them ASAP.