Blog

Treat Warnings as Errors

February 7, 2008

This in one of my pet peeves. Its simply none negotiable!

WarningsAsErrors

I still don't understand why it can be turned off. Heck, I don't understand why its not turned on by default. I even don't understand why the C# compiler even emits warnings instead of errors in the first place. It seems that I don't understand very much, do I ? ;-)

If you want to know why you should always enable the Treat Warnings as Errors option, then just read this post from Derik Whittaker who just joined the club.

So, let's get to the order of the day, shall we? Stand up, put up your right hand and repeat after me: I will always treat compiler warnings as errors.

Now, to make your life a bit easier, you can use John Robbins' most excellent SettingsMaster add-in which comes with the source code of his book Debugging Microsoft .NET 2.0 Applications (if you don't own a copy of this book, then go get one; you are missing out). This particular add-in adds a button to the toolbar of Visual Studio. Just select a project in the Solution Explorer and press the button. That's it. Your set to go.

Push the button

Make it a habit to push that button every time you add a new project to your solution. It will save you a lot of grief in the long run. Trust me, I know. As usual, I found out the hard way.

Profile picture of Jan Van Ryswyck

Jan Van Ryswyck

Thank you for visiting my blog. I’m a professional software developer since Y2K. A blogger since Y2K+5. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.

Comments

About

Thank you for visiting my website. I’m a professional software developer since Y2K. A blogger since Y2K+5. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.

Contact information

(+32) 496 38 00 82

infonull@nullprincipal-itnull.be