Setup
April 27, 2024 ยท View on GitHub
In this Getting Started section, we will walk you through the process of setting up your development environment, creating, debugging, and publishing your first extension.
Note
This guide assumes that you have already installed DevToys and DevToys CLI on your computer. It is also expected that you have some experience with C# and .NET and are familiar with the concept of dependency injection.
The setup process varies slightly depending on the operating system you are developing on. Below are the instructions for Windows, macOS, and Linux.
Windows
Setting the Environment Variable
To debug an extension seamlessly, you need to set a specific environment variable on your system. Follow these steps:
- Locate
DevToys.exeandDevToys.CLI.exeon your computer. If you installed the app using an installer (not through the Microsoft Store), it is likely inC:\Users\[user name]\AppData\Local\Programs\DevToys\DevToys.exe. Keep this path handy for a later step. - Launch a PowerShell command prompt using Windows Terminal or Windows PowerShell app.
- Enter the following command to define the
DevToysGuiDebugEntryPointandDevToysCliDebugEntryPointenvironment variables.
Replace[Environment]::SetEnvironmentVariable("DevToysGuiDebugEntryPoint", "<your_path>\DevToys.exe", "User") [Environment]::SetEnvironmentVariable("DevToysCliDebugEntryPoint", "<your_path>\DevToys.CLI.exe", "User")<your_path>\DevToys.exeand<your_path>\DevToys.CLI.exewith the actual path you located in Step 1.
Selecting Your Editor
We recommend you use Visual Studio 2022 for its robust development capabilities for C# and .NET. This IDE also offers a free tier. However, if you are already familiar with JetBrains Rider, it is an excellent alternative. Finally, Visual Studio Code is another option, particularly if you prefer a more lightweight text editor.
- For Visual Studio users, please select
.NET desktop developmentworkload during installation. - For Visual Studio Code users, please install the C# DevKit and ResX Editor extensions.
- For JetBrains Rider users, install .NET 8.0 if prompted.
macOS
Setting the Environment Variable
To debug an extension seamlessly, you need to set a specific environment variable on your system. Follow these steps:
- Locate
DevToys.appandDevToys.CLI.appon your computer. It is common to find it in~/Applications/DevToys.app. Keep this path handy for a later step. - Launch the Terminal application from your Applications folder or using Spotlight search.
- Enter the command
nano ~/.zshrc. - Within the opened
nanoeditor, append the following line at the end of the document to define theDevToysGuiDebugEntryPointandDevToysCliDebugEntryPointvariables.
Replaceexport DevToysGuiDebugEntryPoint="<your_path_to_DevToys.app>/Contents/MacOS/DevToys" export DevToysCliDebugEntryPoint="<your_path_to_DevToys.CLI.app>/Contents/MacOS/DevToys.CLI"<your_path_to_DevToys.app>with the actual path you located in Step 1. - Save and exit Nano (press
Ctrl+X, then confirm by pressingY, and finally pressEnter) - Enter the command
source ~/.zshrcin the Terminal to apply the changes you made. - Restart macOS.
Selecting Your Editor
We recommend you use JetBrains Rider as it provides a full IDE experience for C#. Visual Studio Code is another option, particularly if you prefer a more lightweight text editor.
- For Visual Studio Code users, please install the C# DevKit and ResX Editor extensions.
- For JetBrains Rider users, install .NET 8.0 if prompted.
Linux
Setting the Environment Variable
To debug an extension seamlessly, you need to set a specific environment variable on your system. Follow these steps:
- Locate
DevToysandDevToys.CLIprograms on your computer. It is common to find it in/usr/bin/devtoysand/usr/bin/devtoys.cli. Keep this path handy for a later step. - Launch the Terminal application.
- Enter the command
nano ~/.bashrc. - Within the opened
nanoeditor, append the following line at the end of the document to define theDevToysGuiDebugEntryPointandDevToysCliDebugEntryPointvariables.
Replaceexport DevToysGuiDebugEntryPoint="<your_path>/DevToys" export DevToysCliDebugEntryPoint="<your_path>/DevToys.CLI"<your_path>with the actual path you located in Step 1. - Save and exit Nano (press
Ctrl+X, then confirm by pressingY, and finally pressEnter) - Enter the command
source ~/.bashrcin the Terminal to apply the changes you made.
Selecting Your Editor
We recommend you use JetBrains Rider as it provides a full IDE experience for C#. Visual Studio Code is another option, particularly if you prefer a more lightweight text editor.
- For Visual Studio Code users, please install the C# DevKit and ResX Editor extensions.
- For JetBrains Rider users, install .NET 8.0 if prompted.