Monday, April 2, 2007

C# Reflection Example - Debug or Release?

Use .NET reflection to gather information about the current application.

For example, to verify whether the current application was compiled in release or debug mode:


  1. Inspect the Attributes collection of the Assembly object specified by a dll path.
  2. Find the Attribute of type DebuggableAttribute.
  3. Check that Attribute's IsJITTrackingEnabled property.

Here is a link to the code.

I used it to display the compile mode in an About screen:




3 comments:

  1. Great site!!! this information really helped me

    ReplyDelete
  2. Good posting, im subscribing to your rss. Thanks for sharing a very informative article. Many thanks once more

    ReplyDelete
  3. Wow, there is a lot of effective info in this post!

    ReplyDelete