.NET Development on Linux

Guide on setting up Linux (CachyOS) for .NET Web Development including packages required/recommended.

While I am ricing my CachyOS, I do still need to work - and that primarily consists of .NET Development. This article covers everything I had to install to get up and running.

The list is not exhaustive and may need to be updated from time to time.

IDE
ApplicationDetailsReference
Visual Studio CodeCommunity managed binary in AURhttps://aur.archlinux.org/packages/visual-studio-code-bin
VS CodiumAlternative to Visual Studio Code stripped of Microsoft data collectionhttps://aur.archlinux.org/packages/vscodium

Personally, I use Visual Studio Code with the C# Dev Kit extension.
You could also go for JetBrains Rider, but I have not used that - so I won’t comment on it.

Packages
PackagesDetailsReference
dotnet-sdkCompiles source code, runs commands, and builds your projectshttps://archlinux.org/packages/extra/x86_64/dotnet-sdk/
aspnet-runtimeProvides libraries to run and host web applications locallyhttps://archlinux.org/packages/extra/x86_64/aspnet-runtime/
dotnet-targeting-packReference assemblies required to compile console and desktop applicationshttps://archlinux.org/packages/extra/x86_64/dotnet-targeting-pack/
aspnet-targeting-packReference assemblies required to compile web and API projectshttps://archlinux.org/packages/extra/x86_64/aspnet-targeting-pack/
netstandard-targeting-packCompilation of cross-platform libraries targeting .NET Standard specificationshttps://archlinux.org/packages/extra/x86_64/netstandard-targeting-pack/

Here is a handy single line install command for the required ones:

1
sudo pacman -S dotnet-sdk aspnet-runtime dotnet-targeting-pack aspnet-targeting-pack netstandard-targeting-pack

Entity Framework Core CLI could also be handy if you plan on building web applications or use databases:

1
dotnet tool install --global dotnet-ef

Finally, Microsoft SQL Server can be a pain to run natively on Arch Linux, so using Docker might help:

1
2
sudo pacman -S docker docker-compose
sudo systemctl enable --now docker

Anything else?

You need to update your PATH environment variable for your terminal to recognize some of those .NET tools.

You can do so via you ~/.bashrc or ~/.zshrc scripts, but since I am on Hyprland, I went with my Hyprland Configurations:

1
2
env = DOTNET_ROOT, /usr/bin/dotnet
env = PATH, $PATH:/usr/bin/dotnet:/usr/bin/dotnet/tools

Run the following command if you are not sure where your binaries are:

1
which dotnet

And that’s a wrap ✌️