dotnet Application Notes

Introduction

.NET is free, cross-platform, open-source developer platform for building many kinds of applications. It can run programs written in multiple languages, with C# being the most popular. It relies on a high-performance runtime that is used in production by many high-scale apps.

Installation

  1. download and extract
    1
    2
    3
    4
    cd ~
    wget ${the direct link of dotnet, for example dotnet 8.0 for arm64 or whatever your platform is}
    mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-8.0.404-linux-arm64.tar.gz -C $HOME/dotnet

  2. load it automatically
    add these two lines at the end of ~/.bashrc
    1
    2
    export DOTNET_ROOT=$HOME/dotnet
    export PATH=$PATH:$HOME/dotnet
    source it to use it for the current terminal and do a checking
    1
    2
    source ~/.bashrc
    dotnet --version

To run a program

1
2
cd ${src dir of a project}
dotnet run

To compile a program to be binary file

1
2
3
cd ${src dir fo a project}
mkdir build
dotnet publish -c Release -r linux-arm64 -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false -o ./build/