Table of Contents

Other .NET SDK/Runtime Installation Methods

Bookworm and Earlier

.NET 10 SDK

Starting with .NET 10, Microsoft is publishing ARM64 Linux packages. Follow Microsoft's Debian 12 instructions to install the .NET 10 SDK on a ComfilePi running the Bookworm OS.

.NET 9 SDK

Prior to .NET 10, Microsoft had not published ARM64 packages for the .NET SDK, so we filled that gap in our Bookworm OS by creating our own .NET SDK installation packages.

sudo apt update
sudo apt install cpi-dotnet-sdk-9.0

.NET 8 SDK

Prior to .NET 10, Microsoft had not published ARM64 packages for the .NET SDK, so we filled that gap in our Bookworm OS by creating our own .NET SDK installation packages.

sudo apt update
sudo apt install cpi-dotnet-sdk-8.0

Bullseye

ComfilePi OS images dated 2022-07-26 or later have the .NET SDK already installed. Verify by running the command dotnet –version in a terminal. If you need a later version than that which is installed, use the manually installation process below.

Any OS

Any version of the .NET SDK can be installed manually using the following commands.

DOTNET_VERSION=10.0  # Choose your version
wget https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh
chmod +x dotnet-install.sh
sudo ./dotnet-install.sh --channel $DOTNET_VERSION --install-dir /opt/Microsoft/dotnet
sudo ln -s /opt/Microsoft/dotnet/dotnet /usr/local/bin/dotnet
 
# Create a configuration file telling the system where to find the .NET runtime
sudo mkdir /etc/dotnet
sudo bash -c 'echo /opt/Microsoft/dotnet/ >> /etc/dotnet/install_location'

Test the installation by running dotnet --version in a terminal.

Workaround for .NET ARM Linux Garbage Collection Bug (.NET 8 & 9 Only)

Important - Due to a bug in the .NET runtime, it may be necessary to restrict the .NET garbage collector's memory limit on devices with small amounts of memory (e.g. a Raspberry Pi) or .NET applications may abort prematurely. To set the garbage collector's memory limit, create or open the file /etc/environment, and add the following line to the file.

DOTNET_GCHeapHardLimitPercent=32

Then reboot.

For more information about this setting, see Microsoft's official documentation.