Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing To App.Config
Message
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01435639
Message ID:
01435754
Views:
40
Hi,

Bear in mind that app.config is not actually used at runtime. The applicationSettings section is in app.exe.config and any userSettings are placed in an automatically created user.config file in the current users local storage. From a design POV it's better to only store unchanging items in the applicationSettings section. Values can be changed through the autogenerated ApplicationSettingsBase derived class ; adding additional elements via file IO, as outlined in the first link, is *not* a good idea - you could, for example, easily end up with different versions in different user.config files...

This may help:http://msdn.microsoft.com/en-us/library/k4s6c3a0.aspx



>Here's another example that seems fairly easy. Yet it's writing to the app.config.
>http://www.codeproject.com/KB/cs/UserSettings.aspx
>
>
>
>>>According to this guy http://ryanfarley.com/blog/archive/2004/07/13/879.aspx it's not a good idea to write to App.Config:
>>>
>>>Warning: As a rule of thumb, it is not good to write back to the config file. The framework does not include this ability for a reason. If you want your application's users to not require administrative rights then it is always a better idea to store settings in the user's documents & settings directory or in the registry if needed. That said, this won't break anything and does come in handy for utility applications etc.
>>>
>>>
>>>1. Why not? Isn't the point of App.config to save app settings?
>>>2. If not, then where's the best place to save user settings?
>>>
>>>Thanks
>>
>>
>>Application settings should normally be in web.config.
>>
>>User settings can be saved in their profiles (part of forms authentication).
Previous
Reply
Map
View

Click here to load this message in the networking platform