VSCode C# setup
Follow these steps to configure a C# development environment using VSCode (Code-OSS variant) with the Free OmniSharp extension.
This setup has been tested on Arch Linux with the following package versions:
- code 1.70.2-1
- dotnet-sdk 6.0.8.sdk108-1
Step-by-step procedure
-
Install
dotnet
sdk and runtime-
Arch Linux setup:
sudo pacman -S dotnet-sdk
-
-
Make a directory anywhere you like. Go inside and use
dotnet
tool to create a sample project withconsole
template:mkdir <ProjectName> cd <ProjectName> dotnet new console
Note: this folder can be deleted later, it is just an example to test if the extension is working
-
Open the editor inside the project folder
code .
-
Install free-omnisharp-vscode extension for C# development
-
Open
Program.cs
file- Note: this step is just to force extension to download OmniSharp implementation
-
Wait until OmniSharp dependencies get installed (it takes time)
-
If editor asks about adding
build & run
targets, sayyes
- It can also be enabled later inside Run & Debug tab
-
Press
F5
to build and execute the example code- Breakpoints are supported, add them to the left of the code
- Open Run & Debug tab to see variables and watch expressions
-
Now the editor is configured and new projects can be created using
dotnet
tool (like in step 2)
Happy hacking!
🐱