Introduction
Microsoft Visual Studio provides a way to add external tools with options from arguments and the initial directory. The output window prompts for arguments. Once an external tool has been set up, it is accessed from the tools menu, which can be inconvenient if used often.
A convenient way to access external tools would be to add tools to the Visual Studio toolbar.
Example configuration of a tool, in this case, calling dotnet restore.
The problem is that when a developer wants to add an external tool to the Visual Studio toolbar, external tools show up as shown below, making it difficult to know which tool is the one to add.
Steps to Solution
First, learn where the settings file is located which may be different for the version of Visual Studio, at time of this article the location for VS2022 is.
C:\Users\UserName\AppData\Local\Microsoft\VisualStudio\17.0_f56beab6\Settings
Where UserName is the developer's Windows Login name. Combine this path with the file name CurrentSettings.vssettings.
Open CurrentSettings.vssettings and a developer will be lost with an unformatted XML file.
Solution
Let's provide ChatGPT with the file CurrentSettings.vssettings and a simple prompt.
Prompt: Using C# read nodes for ExternalTools.
ChatGPT got it right without additional prompts. For ease and a quick solution a .NET Core Windows Form project was used.
Now when a developer wants to add an external tool to Visual Studio toolbar, run this utility to get the external tool name.
Code
Code produced by ChatGPT is straight forwarded and easy to understand. In the source code the file Copilot.md has the full response.
Summary
External tools are a great asset to developers, and the provided utility allows developers to add these tools to Visual Studio’s toolbar for easy access.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.