Recommended location for local config files for an app
Where should my app store local configuration files (like xml files) to retain screen position, etc.?
I just moved my development box from XP to Vista and apparently writing files to some folder inside "c:\program files" is verboten.
So where is the (now) recommended place to store these files?
thanks.
Using .Net 3.5 SP1 and WPF
Re: Recommended location for local config files for an app
That seems to be an issue with the permissions on your system. Usually the config files will be retained in the same folder as your project. Don't you have write permissions on the folder where your project is located?
Re: Recommended location for local config files for an app
a number of applications (Microsoft apps and Google apps) use the C:\Documents and Settings\[user]\Local Settings\Application Data". The "Local Settings" folder is a hidden folder, I believe, so it's a good place to put config files.
Re: Recommended location for local config files for an app
Re: Recommended location for local config files for an app
Is there a C# function to get a filepath to this folder (since it can't be known until installation). And if so, how does it work during development/debugging since the app isn't installed in its final location at that point? (this is for the C:\Documents and Settings\[user]\Local Settings\Application Data method)
Re: Recommended location for local config files for an app
maybe this will help
Code:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
http://msdn.microsoft.com/en-us/libr...ialfolder.aspx
Re: Recommended location for local config files for an app
What happens during debugging... where will that location be since the app isn't installed yet. thanks.
Re: Recommended location for local config files for an app
it's "hidden" here
Code:
C:\Users\USER\AppData\Local\BASE_NAMESPACE_NAME
**edit: I've forgotten to add that this is the path on Vista
Re: Recommended location for local config files for an app
Ok. I think I will go this route.
Next question- I have two .xml files I need to store there, however I need to allow the users to copy their own custom .xml files to this location. Is it possible (within ClickOnce deployment) to copy skeleton versions of these .xml files to the app's local folder, but have the install leave these files alone if they are already there (customized by the user)?