Application Settings

J

John

I have a dll that saves user settings into user.config and it does the
save/retrive right. The problem is when the software starts/initializes, it
does not seem to read from the user.config, it gets the defaults that I
specified in the design time. Here is the code,

Settings settings = Settings.Default;

I want the dll to do the following,
if there's a user.config, read from it;
else read from the fefauts.

How can I do that? Thanks.
 
P

Peter Duniho

John said:
I have a dll that saves user settings into user.config and it does the
save/retrive right. The problem is when the software starts/initializes, it
does not seem to read from the user.config, it gets the defaults that I
specified in the design time.

Are you sure that you've saved the changed to the settings after they've
been changed?

You need to call the Settings.Save() method to write changes back out.

Also, with a DLL you should make sure that the user.config file you
expect to be used is actually used.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top