Questions about application and user settings (Settings.settings) in VS2005

lonewolf32

Newcomer
Joined
May 3, 2006
Messages
17
Hi folks - I have a number of questions regarding app and user settings in Visual Studio 2005.

- I see that app.settings is stored with the EXE and user.settings is stored under the user's home directory. I also see that app.settings values are unchangeable at runtime. I realize this is to comply with Windows logo requirements, but I would like to have settings that are changeable at runtime, stored with the EXE. Is this at all possible?

- Is System.Configuration namespace the one that was used in VS2003 (deprecated)? This namespace provides a way to access a app.config file directly, so I am assuming this is the case. If I am creating an application should I avoid this namespace?

Basically I am looking for a way to remove Registry dependency from my current application. Currently my registry settings are under HKLM (not HKCU) so the settings need to be app-level (not user-level) and they need to be modified at runtime.

Thanks!
 
You can still use the System.Configuration namespace under 2005 - the built in tools just make it easier to work with configs and settings.

The problem with writing changes back to the applications directory is that on XP and higher the user won't have permissions by default - you will need to either relax security on the applications folder (on every single machine), or put the users in a group with sufficient permissions (probably not a good idea as this would mean giving them far more permissions than they need for this single application).

What kind of information are you storing in the app.config file? Is this really something any user could / should modify and affect all other users of the same PC?
 
Yes, I should have clarified -- all of our users are admin level users so writing to Program Files shouldn't be a problem.

I have to admit though, going forward, questioning the admin status of users on Vista. All of our users for XP and lower are admin because we tell them its required. In our app you just can't get anything done without admin access. But with Vista's better UAC - that may have to change.

Something to think about.

Thanks!
 
Back
Top