4

I would like to programmatically change the settings (paths) found in the infamous "External Web Tools" section of the Visual Studio 2017 options. See for instance this answer which refers to that section.

Where are these settings stored? Is there a file or registry key I can alter, or any command line I can invoke, to update the paths?

enter image description here

maz
  • 642
  • 8
  • 14

1 Answers1

3

The External Web Tools paths, along with a whole lot of other environment settings, are stored in the "CurrentSettings.vssettings" file under the user's AppData\Local\Microsoft\VisualStudio\15.0_4c946413\Settings folder. (that last bit after the "15.0_" is a unique value per user so will be different for you)

At least for VS 2017, the file is an xml file and the paths are stored in the "ToolPaths" property for the "Projects_Web Package Management_External Web Tools" Category element.

<Category name="Projects_Web Package Management_External Web Tools"
          Category="{b521100c-f698-4018-b1cf-6421fc59fa9b}"
          Package="{cb03d63d-47be-437d-b26b-1ad8aa7ff394}"
          RegisteredName="Projects_Web Package Management_External Web Tools"
          PackageName="PackageManagementPackage">
    <PropertyValue name="ToolPaths">.\node_modules\.bin;$(VSInstalledExternalTools);$(PATH);$(DevEnvDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$(DevEnvDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin</PropertyValue>
</Category>

I don't know what will happen if you modify the file while VS is running.

You can also go to the Tools menu and then "Import and Export Settings..." and export the settings to a file, modify the file, then import it back into VS.

Jeff R.
  • 1,493
  • 1
  • 10
  • 14
  • 1
    Thanks! As a complement of information, if you change the file while VS is running, it will simply overwrite it with its (in-memory) version when you close it. So that's a no-go. Also, I don't know how to figure out the user-dependent string (e.g. `4c946413`) in the path, but for my needs this was not necessary. – maz Oct 25 '18 at 19:26