For some reason, with VS 2010 and .Net 4, when I try to open some of my windows in the WPF designer I get a NullReferenceException. When I review the code causing the problem it refers to some AddHandler calls I have in the form's Loaded event procedure. I know the events they are refering to are in other files not loaded until you actually run the program, which by the way runs fine. This same code ran fine in VS 2008 and .Net 3.5. I'm thinking this must be a bug. Why is the designer trying to run this code anyway?