Suppress .NET Compiler Warnings

Every now and again, the compiler will throw a warning message for a known issue. For example, some member variable may be set by reflection or an ORM tool like NHibernate. Using the pragma directive can easily solve these issues.

public class PragmaExample
{
#pragma warning disable 0649
    private int neverSetVariable;
#pragma warning restore 0649
}

To figure out what warning to disable, just right click on the warning.

show_error_help

Then click on Show Error Help, which will bring up a dialog where you should select to view to show online help. Then the online help will have the error description, as well as the error number.

ms_help

This four digit error number, 0169, can be replaced in the pragma statement to skip this specific warning. Enjoy.

Thanks to Kirk Evans Blog, which helped me understand how all this works.

2008 in review

2008 was an awesome year for me. Looking back on things, I can’t really believe what all has happened.

  • Wrote my first automated test
  • Setup my first continuous integration server
  • Lead my first team through a few releases
  • Adopted Scrum as agile process
  • Learned a ton of coding best practices
  • Joined the dark side as a manager
  • Experienced an IPO from the inside
  • Attended my first conference
  • And a ton more

If I had to sum up 2008, it was a foundational year. I learned a lot. I experienced a lot. I like to think I built a good foundation for the rest of my career in software development.

As for 2009, my only worry is my head might explode if it resembles 2008. I don’t really have a clue what it is going to entail, but I look forward to it.