In my applicaton im using user settings to store fields betwene runs. Like:
Properties.Settings.Default.bla = "bla";
When i release my code, do i need to include the .exe.config file?? Where are the fields stored??
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Geir LuddePosted Nov 18, 2010, 7:00 AM
Zoran HorvatPosted Nov 16, 2010, 5:24 PM
Regarding user settings, I don't like the fact that it is far away from programmer's control. If you change GUID, for instance, new application will not be able to find previous settings and it will create new file with all settings gone. For that reason, I prefer creating my own file with settings, and to store it in Application Data directory myself. Do not try to store the file in application start-up directory because it will probably be read-only (especially if located under Program Files). Always use user's profile directory for temporary data, or ask user to point to specific read-write directory if you have to store permanent data.
Conclusion is that I'm using .NET Framework support for application settings in professional use, and custom settings in pet projects and in projects with security issues. Using .NET support for settings gives results quickly, but using custom settings gives high quality.
Geir LuddePosted Nov 16, 2010, 4:25 AM
Zoran HorvatPosted Nov 16, 2010, 4:17 AM