Wednesday, October 22, 2008

System.Configuration

This post is to share how a compiler warning helped me in discovering a wonderful tool...

When we use ConfigrationSettings.AppSettings["connection"]

we get a compiler warning-

This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings

So after changing the code to use ConfigurationManager class, you need to add reference to System.Configuration dll to your project. But why do I need to do this, how did it work before? The new class is now in a seperate assembly, but same namespace. Interesting! So I decided to see how it is split across assemblies..

That is when I started using the reflector tool and I cannot describe how wonderful this tool is to understand FCL assemblies and code.



click on the image for a larger view.

I spend 30-60 mins every day with this tool from that day onwards. Higly recommended to every .net programmer.

LutZ Roeder is the original author of this tool. you can download the tool free from here..

http://www.red-gate.com/products/reflector/index.htm

-Sree

No comments: