How to Install C# on Ubuntu 22.04 and Getting Started
C Sharp is a strong-typed, multi-paradigm programming language developed by Microsoft as part of the .NET platform.
C# is a strong-typed, multi-paradigm programming language developed by Microsoft as part of the .NET platform.
In this article we will see how to install on Ubuntu 22.04, however, you can adapt the instructions for any other version or even another distribution.
Before installing, register the keys:
Now install the key:
Tip: execute one command at a time, if your Ubuntu version is different, find 22.04 for the version corresponding to yours. See here all available versions.
Now install the SDK, runtime will also be installed automatically
You can now clean the file:
1. Create a project
If you want to specify the version, use:
dotnet new console -o MyApp -f net6.0
2. Enter the project:
3. Edit the
Change the output as you wish, example:
Now run it at runtime:
Note that it will take a while to run, as it was compiled and then executed. If you want to separate tasks:
The likely and similar output will be:
Now just run the binary: