-
July 5th, 2009, 07:04 AM
#1
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
-
July 5th, 2009, 07:19 AM
#2
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?
-
July 5th, 2009, 07:24 AM
#3
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.
-
July 5th, 2009, 10:22 AM
#4
Re: Recommended location for local config files for an app
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
July 5th, 2009, 10:25 AM
#5
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)
Last edited by purpleflash; July 5th, 2009 at 10:26 AM.
Reason: clarification
-
July 5th, 2009, 10:33 AM
#6
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
Last edited by memeloo; July 5th, 2009 at 10:53 AM.
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
July 6th, 2009, 08:25 AM
#7
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.
-
July 6th, 2009, 08:33 AM
#8
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
Last edited by memeloo; July 6th, 2009 at 08:44 AM.
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
July 6th, 2009, 08:40 AM
#9
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)?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|