Can I run dot NET core on ARM/raspberry pi?

2020-07-13 08:38发布

问题:

I can debug and build on my main machine which is x64 but I'd like to execute the code on my pi. After googling there was a comment that said

you will need to build and publish your code on another machine and then copy it to the Pi.

However he seemed to be unsure and it appears I should execute by using dotnet which appears not to be arm so it appears theres no way to run the app

How do I run my app on dot net core on a raspberry pi?

回答1:

Not yet, there are no official sdk builds for ARM. Seems that they are close, but I haven't heard for any schedules. This is the thread I check from time to time to track their progress. https://github.com/dotnet/coreclr/issues/3977



回答2:

Yes! Now with .net core 2.0 and the corresponding sdk you can publish your application for arm architectures: dotnet publish -c Release -r linux-arm. Copy the resulting binaries to you RPi and enjoy.

Be aware of some pre-requisites for linux such as the following packages: curl, libunwind and gettext.

You can check this post for more info: Toggle Raspberry Pi GPIO pins with ASP.NET Core 2.0



标签: .net-core