1

I've been experimenting with the project settings feature of C# projects, and I'd like to find the xml file containing all the user settings. It should be in my App Data folder in Documents and Settings, but from there I can't seem to find it.

Where does this file get saved?

Edit:
I am using Windows XP and have Show Hidden files turned on and Hide OS files turned off.

Based on https://stackoverflow.com/questions/621265, it looks like it should be stored at:

%AppData%\[CompanyName]\[ExeName]_Url_[some_hash]\[Version]\

I've checked in All Users/Application Data and in my username/Application Data, but can't see anything. I also don't know where CompanyName and ExeName are being populated from--I'm just running the project through the VS debugger.

Community
  • 1
  • 1
Slider345
  • 4,558
  • 7
  • 39
  • 47
  • Do you create these "project settings" by using the Visual Studio IDE, or by using an API (and, if so, which API)? – ChrisW Sep 29 '10 at 23:17
  • Just by using the IDE. I'm using VS 2010, looking at the Settings tab of the properties for my project. – Slider345 Sep 29 '10 at 23:37
  • possible dup http://stackoverflow.com/questions/621265/net-2-0-application-settings-user-config-file-location – aqwert Sep 29 '10 at 23:55
  • @aqwert not exactly a dup, but helpful. – kenny Sep 30 '10 at 00:08
  • @aqwert, thanks for the link. It looks like part of my problem is that I don't know the [CompanyName] and [ExeName] values. Are these set by an environment variable in windows? Maybe they are set through a deployment project? – Slider345 Sep 30 '10 at 00:23
  • 1
    What I do is do a search within all files on a root folder (like AppData) for some known string in the user settings file. If you want to locate it. – aqwert Sep 30 '10 at 05:47

3 Answers3

1

I suspect the directory is there, but hidden. Are you using Win7?

details on XP:

C:\>dir "\Documents and Settings\All Users"
 Volume in drive C has no label.
 Volume Serial Number is 805B-45EC

 Directory of C:\Documents and Settings\All Users

05/28/2010  05:34 AM    <DIR>          .
05/28/2010  05:34 AM    <DIR>          ..
09/29/2010  05:30 PM    <DIR>          Desktop
05/28/2010  05:32 AM    <DIR>          Documents
05/28/2010  01:24 AM    <DIR>          Favorites
05/28/2010  01:32 PM    <DIR>          Start Menu
               0 File(s)              0 bytes
               6 Dir(s)  29,000,216,576 bytes free

C:\>dir "\Documents and Settings\All Users\Application Data"
 Volume in drive C has no label.
 Volume Serial Number is 805B-45EC

 Directory of C:\Documents and Settings\All Users\Application Data

09/03/2010  10:17 AM    <DIR>          Sun
05/28/2010  05:55 AM    <DIR>          VMware
05/28/2010  12:39 PM    <DIR>          Windows Genuine Advantage
               0 File(s)              0 bytes
               3 Dir(s)  29,000,216,576 bytes free
kenny
  • 21,522
  • 8
  • 49
  • 87
1

Thanks for all of your comments. I ended up searching for a known string that should have been in settings file, and was able to find it that way(thanks to @aqwert). The path turned out to be:

C:\Documents and Settings\[myusername]\**Local Settings**\Application Data
  \[MyProjectName]\[MyProjectName].vshost.[random characters]\1.0.0.0\user.config

The problem was that I wasn't looking inside the Local Settings folder. I had another Application Data folder inside my user folder just like Kenny did in his post.

Slider345
  • 4,558
  • 7
  • 39
  • 47
0

Settings are usually stored in the same directory as your application.

The name of the file is the same as the assembly, with .config added to it. If the assembly name is test.exe the settings will be stored in test.exe.config

Brad Bruce
  • 7,638
  • 3
  • 39
  • 60
  • I think he is talking about Settings not App.Config. If so, it's located in the OS directory for App Data. – kenny Sep 30 '10 at 00:04