0

How can I read the locations in C# / .NET? Any idea on how to find the current settings, below are details and where I have looked?

Currently I'm using Win 10 - Visual Studio 2019 - version 16.11.26 (some of the listings of folders are a little different between versions. I'm hoping they are all the same to read though)

When you open "Options", then go to "Project and Solutions", then to "Locations" You get a list of folder locations, where things are stored or created.

  • Project location:
  • User project template location:
  • User item template location:

I'm looking to get what these folder values are in C#. I have looked in the registry under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio (and all the subfolders)
Nothing seems to be in C:\Users(username)\AppData under Roaming\Visual Studio Setup\
Local\
LocalLow

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Gauthier
  • 1,251
  • 10
  • 25

1 Answers1

1

For VS 2022, my settings file is located at %userprofile%\AppData\Local\Microsoft\VisualStudio\17.0_b68e6374\Settings\CurrentSettings.vssettings

Since you are asking about VS 2019, the folder "17.0_b68e6374" probably starts with a "16" for you. The .vssettings file is an xml file that you can parse for the keys of interest. When I was checking, VS did not commit my settings to file until I closed Visual Studio.

*Verified using VS 2022, but the path appears to be essentially the same based on other internet posts.

Sean M
  • 53
  • 6
  • There are many settings in that file, just not what im after. @Hans-Passant pointed to the fake registry hive question. It is a insane binary file, and that is way more effort then its worth at the moment, but ill give you an upvote. Thanks for trying! Turns out i couldn't find the duplicate... as its named wildly different – Gauthier Jul 06 '23 at 14:18