Baixar Visual Studio para desenvolvimento C#

Visual Studio is a Microsoft proprietary application and there is (and probably never will be) a Linux version of it. But you have a few options on developing C# based applications in Linux.

Installation

The first choice you need to make is to which IDE you want to use. For C# i highly recommend VSCode as it has proper IntelliSense support. Install it with:

flatpak install -y com.visualstudio.code

Next comes the desired .NET implementation. There are currently two of them: Microsofts .NET Core SDK and Mono. For my example i use Microsoft .NET Core SDK 6:

sudo flatpak install -y org.freedesktop.Sdk.Extension.dotnet6//21.08
flatpak override --user --env=FLATPAK_ENABLE_SDK_EXT=dotnet6 com.visualstudio.code
flatpak override --user --env=PATH=/app/bin:/usr/bin:/usr/lib/sdk/dotnet6/bin
flatpak override --user --env=DOTNET_ROOT=/usr/lib/sdk/dotnet6

Now that everything is installed, fire up VSCode and create a .cs file. It will ask for installing the necessary Plugin, confirm and install it. In the preferences set the following:

image

Create your first project

Open VSCode and open the directory where you want your new project to be in. Then open the VSCode Terminal and enter:

dotnet new console --type project

As soon as the command has finished the editor is refreshed with the new files and you can start coding. To build and run the application:

dotnet build
dotnet run

This is just scratching the surface, to take full advantage of VSCode, the Plugin and .NET Core you have to read through the documentation on how to properly configure everything to work smooth (like runtime configurations, build configurations, …)