Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way of installing dotnet core on a raspberry pi?

This method

https://blogs.msdn.microsoft.com/david/2017/07/20/setting_up_raspian_and_dotnet_core_2_0_on_a_raspberry_pi/

leaves me with a problem... when I do

pi@raspberrypi:~ $ dotnet --version

I get the following statement... and no version

Did you mean to run dotnet SDK commands? Please install dotnet SDK from: 
  http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

If I do (as the link suggests) and use this protocol https://www.microsoft.com/net/core#linuxdebian

then when I do the install step

sudo apt-get install dotnet-sdk-2.0.0

then the package is not found.

like image 592
Loofer Avatar asked Dec 23 '22 14:12

Loofer


1 Answers

.NET Core distributions come in two variants. The Runtime and the SDK. dotnet figures out whether you want to use the Runtime or the SDK and dispatches your command to the right place.

The error you see is because --version is an SDK command [1]. dotnet tries to redirect it to the SDK, sees there is not SDK around, and suggests you install it.

If you have a dotnet command that seems to do something, chances are you installed it correctly already!

If you just want to see that dotnet works, try dotnet --info, instead:

$ dotnet --info

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : N/A

For Raspberry Pi devices, only the Runtime is available. The SDK, even if available, would probably be too slow and a bit too resources intensive to provide a good experience. So the suggestion is to use the SDK on another computer (say, Linux on Intel x86_64) to target the raspberry pi runtime (dotnet publish -r linux-arm -c Release) and then copy and run it on Raspberry Pi (dotnet /path/to/published.dll).

[1] I think it is completely silly and wrong. But such is life.

like image 158
omajid Avatar answered May 02 '23 19:05

omajid