I recently ran into an issue where I used a property that was introduced in the .NET Framework 2.0 SP1. This caused the code to fail completely on a pre-SP1 machine. Now I’m starting to wonder if there are any other hidden bugs like this waiting to pop-up. Is there a tool, or any way to scan an assembly and see if there are any methods/fields/properties/whatever that are dependent on a framework service pack? Maybe something like FxCop or Reflector could do this, but I’m not sure how to do this. Any help would be much appreciated.
Just for reference, the property that was introduced in 2.0 SP1 that I tried to use was the Font.OriginalName property.
I’d recommend looking into FxCop for this. Krzysztof Cwalina at Microsoft wrote some rules that should help you. Scott Hanselman also has a list of changes from 2.0.50727.42 to 2.0.50727.1378 (which is where you’ll see your OriginalFontName property).
As a side note, according to Microsoft’s documentation for OriginalFontName