abhi
abhi

Reputation: 3136

ConfigurationManager Class

How do you use the COnfigurationManager class to read and write to the settings file?

Upvotes: 1

Views: 2668

Answers (3)

Bronumski
Bronumski

Reputation: 14272

I could try and give you the breakdown here but really the following links, all written by Jon Rista, are the best resources I have found regarding the System.Configuration namespace.

Unravelling the Mysteries of .NET 2.0 Configuration

Decoding the Mysteries of .NET 2.0 Configuration

Cracking the Mysteries of .NET 2.0 Configuration

Upvotes: 4

Alex Humphrey
Alex Humphrey

Reputation: 6209

One thing that might catch you out is that to access the ConfigurationManager class you have to manually add a reference to System.Configuration. The System.Configuration namespace is split across multiple assemblies - you only get part of it by default.

Space Cracker posted some good links, but there is also a way to write strongly typed configuration sections, which I blogged about a few years ago - Configuring a .NET 2.0 Application Using the ConfigurationSection class. I've literally never seen anyone else use strongly typed ConfigurationSections, but once you get used to them they're quite useful.

Upvotes: 3

Related Questions