Accessing App.config

ganders

Freshman
Joined
Nov 25, 2004
Messages
32
hi folks

i'm developing a class library that is supposed to access to App.config an read/write some values. i'm allways getting an error "key is not defined...".

Dim test As String
Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader
test = CType(configurationAppSettings.GetValue("pw", GetType(System.String)), String)

but using the same code inside a winform-application works perfect. so there must be some main diferences in accessing the config-file in class libraries or in winform-applications...

can anybody help me out please?

best regards

georg
 
The app.config file is really designed for adminstrative control not end user settings. If you are running on a more secure OS (XP, win2k3 possibly win2k) a normal user should not have permissions to write to the 'program files' folder anyway. If you store settings under the user profile (directly or via Isolated Storage as mentioned by IngisKahn above) then they can take advantage of OS provided features (roaming profiles, separate user configs etc).
 
ganders said:
fine, but what exactly is 'isolated storage'?
Just a location within a particular user's profile that is projected with the same level of security as their login. Other users of the system will not be able to access anything stored in another user's Isolated Storage.
 
Back
Top