In VS 2015 and earlier, settings were stored in the registry, e.g. HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0_Config
. In VS 2017, to support multiple instances of VS, the settings were moved out of the registry, according to this post.
I have previously been editing the registry to force Dark Theme when Windows is in High Contrast mode, according to this SO answer. Now I want to do the same in VS 2017 but cannot find where the settings are stored, to make this change.
Where are these settings stored for Visual Studio 2017?
Settings. settings is located in the My Project folder for Visual Basic projects and in the Properties folder for Visual C# projects.
vssettings file in %userprofile%\Documents\Visual Studio 2019\Settings is in an installation-specific folder that is similar to %localappdata%\Microsoft\VisualStudio\16.0_xxxxxxxx\Settings.
In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.
Visual Studio keeps the settings store in the system registry. Open Regedit.exe. Navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0Exp_Config\InstalledProducts\.
Navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0Exp_Config\InstalledProducts\. Make sure that you are looking at the key that contains \14.0Exp_Config\ and not \14.0_Config\. When you run the experimental instance of Visual Studio, configuration settings are in the registry hive "14.0Exp_Config".
The project configuration determines what build settings and compiler options are used when you build the project. To create, select, modify, or delete a configuration, you can use the Configuration Manager. To open it, on the menu bar, choose Build > Configuration Manager, or just type Configuration in the search box.
In Visual Studio 2019, you can create a .vsconfig file right from Solution Explorer: Right-click on your solution. Click Add > Installation Configuration File. Confirm the location where you want to save the .vsconfig file (defaults to your solution root directory).
I found the answer in this blog post:
See how empty is the regular HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0 key on my machine and notice that there is no 15.0_Config key:
Instead, the VS 2017 private registry is stored in your AppData folder:
Fortunately, you can use regedit.exe to load a private hive. You need to select the HKEY_USERS node, and click the File > Load Hive… menu. You select the privateregistry.bin file, give a name to the hive (I entered “VS2017PrivateRegistry”) and now you can see the 15.0_Config key populated as usual (note: use File > Unload Hive when done):
Using this guide, I was able to load the private registry, do the changes from the SO answer mentioned earlier, unload the hive and start VS 2017 with the Dark Theme!
EDIT: I had to slightly modify the PowerShell script I used to edit the registry, here is the updated version if anyone is interested:
EDIT2: Now modified to include the loading of the private registry automatically as well, including a garbace collection to allow unloading the hive:
NOTE: You have to find your own correct path for the user name (C:\Users\Geir
) and VS version (15.0_8165452c
).
New-PSDrive HKU Registry HKEY_USERS reg load 'HKU\VS2017PrivateRegistry\' "C:\Users\Geir\AppData\Local\Microsoft\VisualStudio\15.0_8165452c\privateregistry.bin" $HighConstrastTheme = "HKU:\VS2017PrivateRegistry\Software\Microsoft\VisualStudio\15.0_8165452c_Config\Themes\{a5c004b4-2d4b-494e-bf01-45fc492522c7}" $DarkTheme = "HKU:\VS2017PrivateRegistry\Software\Microsoft\VisualStudio\15.0_8165452c_Config\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}" Remove-Item -Path $HighConstrastTheme -Recurse Copy-Item -Path $DarkTheme -Destination $HighConstrastTheme -Recurse [gc]::collect() reg unload 'HKU\VS2017PrivateRegistry'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With