Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Administrators
Posted
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).

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
fine' date=' but what exactly is 'isolated storage'?[/quote']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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...