DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Build a Simple Chat Server With gRPC in .Net Core
  • Working With dotConnect for Oracle in ASP.NET Core
  • Creating a .NET Core 2.1 Class Library Project Using ADO.NET
  • All Things ASP.NET Core and MVC: Tutorials and Articles

Trending

  • REST vs. Message Brokers: Choosing the Right Communication
  • Podman Desktop Review
  • Build a Serverless App Fast With Zipper: Write TypeScript, Offload Everything Else
  • GenAI-Infused ChatGPT: A Guide To Effective Prompt Engineering
  1. DZone
  2. Data Engineering
  3. Big Data
  4. Installing ASP.NET Core 3.0 on RaspberryPi and Windows 10 IoT Core

Installing ASP.NET Core 3.0 on RaspberryPi and Windows 10 IoT Core

Get ASP.NET 3.0 Core on your RaspberryPi.

Gunnar Peipman user avatar by
Gunnar Peipman
·
Aug. 01, 19 · Tutorial
Like (2)
Save
Tweet
Share
24.32K Views

Join the DZone community and get the full member experience.

Join For Free

ASP.NET Core 3.0 will run on RaspberryPi and other boards out of the box. There are also SDK binaries available in .NET Core 3.0 download page. Having a full SDK available on RaspberryPi means that we can now build applications on board. Let’s see how it works.

Installing .NET Core 3.0 on a RaspberryPi

For this tutorial, I'm going to use a RaspberryPi 2 with the latest Windows 10 IoT Core. In order to download .NET Core 3.0, follow these next steps: 

  1. Download ARM SDK binaries from .NET Core 3.0 download site.
  2. Open the RaspberryPi disk in Windows Explorer (\\minwinpc\u$) — you may have one disk (C:). That’s okay to use.
  3. Create a folder called, "dotnet."
  4. Copy the files from the ARM SDK archive to the dotnet folder on the RaspberryPi.

Let’s make sure everything works as expected.

  1. Open Powershell as admin and connect to RaspberryPi.
    Enter-PSSession -ComputerName minwinpc -Credential minwinpc\Administrator

  2. Add the dotnet folder to the path.
    $Env:Path += ";C:\dotnet\"

  3. Run the following dotnet command to see if .NET Core works.
    dotnet –info
     

If there were no problems or errors, we are good to continue with developing .NET Core 3.0 applications on RaspberryPi and Windows 10 IoT Core.

Development Options

Before building the web application, I have a few words to say about development options.

As Windows 10 IoT Core doesn’t have a command line text or code editor, we cannot go with pure command line ASP.NET Core development. We have to open the code folder with Windows Explorer on some other machine. From there, we can use whatever we like to use for coding, be it Visual Studio, Visual Studio Code, or some other code editor.

We can build an application in a dev box or on Windows 10 IoT Core. It’s up to us, but we have to run the application on Windows 10 IoT Core for sure. For this, we have to use Powershell or SSH.

Visual Studio Code Remote

Visual Studio Code has something called Remote. It is a set of extensions that allows us to build and run code on a remote machine. Currently, Windows 10 IoT Core is not supported. I have a secret hope that it will happen one day also for Windows 10 IoT Core.

Visual Studio Code: Remote architecture

Visual Studio Code: Remote architecture


If you are running Linux on RaspberryPi, then head over to blog post Visual Studio Code Remote Development over SSH to a Raspberry Pi is butter by Scott Hanselman.

Creating ASP.NET Core application Windows IoT Core

Let’s create a default ASP.NET Core application now.

  1. Create a folder for an application and move to the folder
    mkdir webappcd webapp
  2. Run dotnet utility to create a new web application
    dotnet new mvc

  3. Make sure CreateHostBuilder method looks like this: 
    public static IHostBuilder CreateHostBuilder(string[] args) =>    Host.CreateDefaultBuilder(args)        .ConfigureWebHostDefaults(webBuilder =>        {            webBuilder.UseStartup<Startup>();            webBuilder.UseUrls("http://*:5001/");        });

  4. Open port 5000 in Windows IoT Core firewall settings by command
    netsh advfirewall firewall add rule name="ASP.NET Core" dir=in action=allow protocol=TCP localport=5001

  5. Build and run the application
    dotnet build --runtime win10-arm
    dotnet run --runtime win10-arm
  6. Open the browser and type in the address of web application (http://minwinpc:5000).ASP.NET Core 3.0 on RaspberryPi
    ASP.NET Core 3.0 on RaspberryPi

There’s actually more for ASP.NET Core 3.0 on RaspberryPi — we can also write applications that communicate with hardware. This is a separate topic to cover in future blog posts.

Wrapping Up

ASP.NET Core 3.0 works on RaspberryPi with all command line tooling. Besides running applications, we can also build them on a RaspberryPi. On Windows 10 IoT Core, we cannot perform full command line development; rather, we need some external machine where a code editor can run. Those who run Linux on RaspberryPi can go with Visual Studio Code Remote to build and run applications straight on board. Windows 10 IoT Core users have to use mapped network drive and regular tooling. 

ASP.NET ASP.NET Core IoT .NET Web application

Published at DZone with permission of Gunnar Peipman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Build a Simple Chat Server With gRPC in .Net Core
  • Working With dotConnect for Oracle in ASP.NET Core
  • Creating a .NET Core 2.1 Class Library Project Using ADO.NET
  • All Things ASP.NET Core and MVC: Tutorials and Articles

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: