Wednesday, August 18, 2010

How do you load a dictionary into a console application from an app.config?

Programmer Question

Hello,



I want to load a dictionary at startup in my console app from my app.config.



I know that I could use an xml library or linq to XML to load it to parse and traverse it. My question is there a BUILT IN way of doing it.



Isn't there some way to add an application configuration section into the app.config and then have it loaded automagically using ConfigurationManager class in the System.Configuration namespace?



Any example? BTW, I am in NET20.



EDIT

Sorry, I should have clarified. I want to load the dictionary WITHOUT using AppSettings. I know how to do that already. Of course, the downside of using AppSettings is that I have to change my code to add new values to my dictionary. That is why I am looking for a way to do it automatically.



Seth



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails