Languages

Install the .NET SDK

The latest long-term-support .NET SDK for C# and F#, plus your first app.

  1. Install the .NET SDK
    Terminal
    brew install --cask dotnet-sdk
  2. Create and run an app
    Terminal
    dotnet new console -o hello && cd hello && dotnet run

Check it worked

  1. Check the version
    Terminal
    dotnet --version
Undo it
  1. Uninstall the .NET SDK
    Terminal
    brew uninstall --cask dotnet-sdk
  1. Install the libraries .NET needsNeeds sudo
    Terminal · Ubuntu / Debian
    sudo apt install -y libicu74

    Usually already there on Ubuntu Desktop. Harmless if it is.

  2. Install the .NET SDK with Microsoft's script
    Terminal · Ubuntu / Debian
    curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel LTS

    Installs into your home folder, so no sudo is needed.

  3. Add it to your PATH
    Terminal · Ubuntu / Debian
    echo 'export DOTNET_ROOT="$HOME/.dotnet"' >> ~/.bashrc
    echo 'export PATH="$PATH:$HOME/.dotnet:$HOME/.dotnet/tools"' >> ~/.bashrc
    source ~/.bashrc
  4. Create and run an app
    Terminal · Ubuntu / Debian
    dotnet new console -o hello && cd hello && dotnet run

Check it worked

  1. Check the version
    Terminal · Ubuntu / Debian
    dotnet --version
Undo it
  1. Remove the .NET SDK
    Terminal · Ubuntu / Debian
    rm -rf ~/.dotnet

    Then delete the two dotnet lines from ~/.bashrc.

  1. Install the .NET SDK
    PowerShell
    winget install Microsoft.DotNet.SDK.10

    Close and reopen PowerShell afterwards.

  2. Create and run an app
    PowerShell
    dotnet new console -o hello; cd hello; dotnet run

Check it worked

  1. Check the version
    PowerShell
    dotnet --version
Undo it
  1. Uninstall the .NET SDK
    PowerShell
    winget uninstall Microsoft.DotNet.SDK.10