Reputation: 2871
On my windows form application i'm saving some application theme information to app.config <appSettings/>
section i used read app.config like this
var config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
it works. but once i created installer using installshield when i save settings it shows file access permission denied because app install in to C:\Program Files (x86)
how to enable access permission on app.config when i use installshield or if the way i doing it wrong what is the best practices.
Regards
Upvotes: 1
Views: 2426
Reputation: 1251
Applications run by only an administrator user will have the modify permission on files in the Program Files folder (or Program Files x86). For this reason, it's best practice to store settings that will be saved by the application in a separate settings file, stored in the user's AppData folder. Different users can then have their own values, stored in their individual file, and the app.config file can be used to store default values for all users.
The answer to this post gives instructions on how to implement a mechanism of storing User Settings.
Upvotes: 1