Dotnet

Dotnet on Linux wasn’t bad at all, very smooth threshold of entry and it reminds me a lot of Python in its ease of adoption. Thumbs up Microsoft!

Installing dotnet on Fedora

sudo dnf install dotnet -y

Start a project

A project is necessary to add dependencies and libraries with dotnet add.

mkdir dotnet-examples; cd dotnet-examples
dotnet new console

Test build

dotnet build

By default this will place build artefacts into ./bin and you can execute the program like this.

./bin/Debug/net6.0/dotnet-examples
Hello, World!

Add dependencies

dotnet add package Spectre.Console
dotnet add package Spectre.Console.Cli

Use dependencies

Now I’ve heavily modified the Program.cs file to use the Spectre library. You can find the git repo of the code here.

I simply run dotnet build again, and execute the same binary.

See also