0

I have on my PC a C# WinForms application which was installed via MS click-once deployment.

I can see that the user.config file used by Settings is located in a folder under:

C:\Users\<me>\AppData\Local\Apps\2.0\Data\<several other folders>\Data\<version string>

but those other folders have seemingly meaningless random names.

How does the app (or the framework, really) know where to find that user.config file? I need to access it from another application, and don't want to have to open a "Find File" dialog for the User to do it...

I have tried searching the Registry for that location, without success.

Thanks

radders
  • 923
  • 8
  • 29
  • It's based on several settings within the properties of the project: this has more info on it: https://stackoverflow.com/questions/11407899/how-is-user-config-created-and-how-it-is-used – J. Scott Elblein Jan 31 '21 at 04:06
  • I had seen that entry, but ty anyway. It doesn't answer the specific question I posed. Maybe only MS know the answer? – radders Jan 31 '21 at 10:16

2 Answers2

0

Application directory

Examine the value of Environment.GetFolderPath(SpecialFolder.ApplicationData) for the exact directory for the current user.

raulmd13
  • 201
  • 2
  • 10
0

I found the local user settings stored C:\Users\ currentUserName \AppData\Local\ my_application

Where as Environment.GetFolderPath(SpecialFolder.ApplicationData) returned C:\Users\ currentUserName \AppData\Roaming
But thanks to @raulmd13 for the clue

Gideon
  • 31
  • 3