Step by step: Running ASP.NET Core on Raspberry Pi

After reading .NET Core on Raspberry Pi and successfully running a console application on Windows 10 IoT Core on my Raspberry Pi 3 I decided to write: Step by step: Running ASP.NET Core on Raspberry Pi.

First be aware of the following prerequisites:

Now let’s start:

1. Create a folder for your new project
2. Create a global.json file
3. Create the ASP.NET Core project
4. Modify the project file
5. Add a Nuget.config file and restore packages
6. Modify Program.cs
7. Publish the application
8. Copy libuv.dll
9. Copy the files to your Raspberry
10. Run the application

You should be good to go and be able to browse on port 5000 of you RPi.

Get the code here: https://github.com/cmendible/dotnetcore.samples/tree/master/aspnet.on.rpi

Hope it helps!

19 thoughts on “Step by step: Running ASP.NET Core on Raspberry Pi

  1. Following the instructions, I didn’t get a NuGet.config that pointed to the right myget feed. You need one that has something like this to have restore work with 2.0 daily builds.

      1. I am using 2.0.0-preview1-005448 of the SDK. The problem is that `dotnet new mvc` hasn’t been updated to include NuGet.config. `dotnet new console` does do it.

  2. You can get rid of the whole win7-arm and then copy stuff by just referencing this package directly. There was a fix in that package in Nov that made it work properly:

  3. Hi,
    thanks Carlos, i tried the same thing for ubuntu arm and it works, but the publish does not produce a completed self contained application (it does not produce the ELF executable to run the web app). But it works running it with dotnet AppName.dll

  4. Hi Carlos
    Thanks this help a lot. It’s a bit annoying having to have 2 projects (one with a different *.csproj & startup.cs files to run on dev machine) but it works. Do you know how to add the Windows IoT Extension SDK to this so I can access the RPI GPIOs from the web page?
    Daniel.

  5. Awesome posts, Carlos!

    After updating my code to what you had, I was able to at least get things running — the downside is that I’m getting an internal 500 every time I have an issue. Do we know where the logs are being dumped at?

Leave a Reply

Your email address will not be published. Required fields are marked *