Setting Up .NET Core on a Raspberry Pi

Now that we can ssh into Raspberry Pi, let’s get it up and running with .NET Core.

.NET Core currently not installed

At the time of writing, we downloaded the ARM32 .NET SDK version 5.0.401, however we can download a later/different version by visiting the .NET Download page. We can get more details about the installed Raspberry Pi OS so that we install the correct SDK by using the “cat /etc/os-release” and “uname -m” command.

Download and install the .NET SDK onto the raspberry pi by issuing the following commands:

sudo apt-get install curl libunwind8 gettext
mkdir -p $HOME/dotnet
tar zxf dotnet-sdk-5.0.401-linux-arm.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet 
export PATH=$PATH:$HOME/dotnet

Note that the two “export” command only applies to the current shell session. To make them permanent, we will need to add them to “.bashrc”. Otherwise I think we are ready to go.

Now let’s quickly create a Hello World console app just to make sure the tooling and things are correctly installed.

There we have it. The .NET 5 SDK (and therefore also the .NET 5 runtime) are installed. So whether we want to develop on target or cross compiled, the options are there.

Categories: .NET, Raspberry Pi, Tooling

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: