2017-01-19 18:06:56 +01:00
# .NET Core on Raspberry Pi
2017-03-12 05:41:02 +01:00
Arm32 support for .NET Core is still being brought up, but there are now daily runtime builds that are ready to use.
There is no SDK that runs on ARM32 yet, but you can publish an application that will run on a Raspberry Pi.
2017-02-25 01:32:15 +01:00
2017-03-12 05:41:02 +01:00
These steps have been tested on a RPi 2 and RPi 3 with Linux and Windows.
2017-01-19 18:06:56 +01:00
2017-03-20 21:52:07 +01:00
## Creating an app:
2017-01-19 18:06:56 +01:00
2017-02-25 01:32:15 +01:00
* [Install .NET Core 2.0 SDK ](https://github.com/dotnet/cli/tree/master ) into a supported developer configuration.
2017-01-19 18:06:56 +01:00
2017-03-28 12:27:42 +02:00
* From the terminal/commandline create a folder named `helloworld` and go into it.
* Run `dotnet new console`
* You can find `helloworld.csproj` file is created under current directory.
* Edit the `helloworld.csproj` file to look like this (Note the version may be newer for RuntimeFrameworkVersion but not lower than 2.0.0-beta-001620-00).
2017-02-25 01:32:15 +01:00
```
< Project Sdk = "Microsoft.NET.Sdk" >
2017-01-19 18:06:56 +01:00
2017-02-25 01:32:15 +01:00
< PropertyGroup >
< OutputType > Exe< / OutputType >
< TargetFramework > netcoreapp2.0< / TargetFramework >
2017-02-27 22:13:55 +01:00
< RuntimeFrameworkVersion > 2.0.0-beta-001620-00< / RuntimeFrameworkVersion >
2017-02-25 01:46:51 +01:00
< RuntimeIdentifiers > win8-arm;ubuntu.14.04-arm;ubuntu.16.04-arm< / RuntimeIdentifiers >
2017-02-25 01:32:15 +01:00
< / PropertyGroup >
2017-01-19 18:06:56 +01:00
2017-02-25 01:32:15 +01:00
< / Project >
```
2017-01-19 18:06:56 +01:00
2017-02-25 01:34:01 +01:00
* Run `dotnet restore` .
2017-03-28 12:27:42 +02:00
* Run `dotnet publish -r <runtime identifier>` for example `dotnet publish -r win8-arm` to publish the application for windows and `dotnet publish -r ubuntu.16.04-arm` for ubuntu 16.04 running on Raspberry Pi.
2017-01-19 18:06:56 +01:00
2017-02-25 01:46:51 +01:00
* Under `./bin/Debug/netcoreapp2.0/<runtime identifier>/publish` or `.\bin\Debug\netcoreapp2.0\<runtime identifier>\publish` you will see the whole self contained app that you need to copy to your Raspberry Pi.
2017-01-19 18:06:56 +01:00
2017-03-20 21:52:07 +01:00
## Getting the app to run on the Pi.
2017-01-19 18:06:56 +01:00
2017-03-20 21:52:07 +01:00
### Linux (Ubuntu)
2017-01-19 18:06:56 +01:00
* Install [Ubuntu 14.04 or 16.04 ](https://www.raspberrypi.org/downloads/ ) on your Pi.
* Install the [prereq packages ](https://github.com/dotnet/core/blob/master/Documentation/prereqs.md ) for .NET Core.
2017-03-10 08:13:34 +01:00
* Copy your app to the Raspberry Pi and execute run `./helloworld` to see `Hello World!` from .NET Core running on your Pi!
2017-01-19 18:06:56 +01:00
2017-02-25 01:32:15 +01:00
Note: While it is possible to build the product on the Pi, it isn't easy today and it's slow. We are working on making it very easy to do.
2017-01-19 18:06:56 +01:00
2017-03-20 21:52:07 +01:00
### Win10 IoT Core
2017-01-19 18:06:56 +01:00
* Install [Windows 10 IoT Core ](https://developer.microsoft.com/en-us/windows/iot/GetStarted ) on your Pi.
2017-02-25 01:34:43 +01:00
* Copy your app to the Raspberry Pi and execute run `helloworld.exe` to see `Hello World!` from .NET Core running on your Pi