Outsmarting Yourself with Reflection, Release Mode, and Inlining

The Problem
I have a WPF app that's in testing that came back with some weird issues this week. The app uses Client Object model to consume SP2010 lists, and UX is a factor in the design, so we have decided to do some Metrics recording to see how people interact with the app. We want to know what features people use, and which efforts were wasted.

Strangely, we started noticing that the names of the Metrics, which were also being written to a SP list, were displaying some incorrect results. Names like "ShowAllItemsOpened" were instead "showAllMenuItem_Click". What's that you say? Clearly that's the name of an event handler! Well you'd be right! But it worked before! What changed in testing? First, some background information ...

1 comment :

  1. A co-worker pointed out to me that as of .NET 4.5, there are parameter attributes that allow some of the information you're looking for to be provided _by the compiler_. Since the compiler does the lifting, there is no performance hit.