Syed Sanoor
Published © MIT

Windows 10 IoT Core - Publish ASP.NET Web Application

Publish an asp.net web application in RaspberryPi running Windows 10 IoT core.

IntermediateProtip49,476
Windows 10 IoT Core - Publish ASP.NET Web Application

Things used in this project

Story

Read more

Code

Setup unstable aspnet feed

Powershell
This will configure the $env variable to access the unstable feed. We need this configured to download the beta versions of dnx
$env:DNX_UNSTABLE_FEED = "https://www.myget.org/F/aspnetmaster"

Download and Install DXN Runtimes

Powershell
Download and Install DXN Runtimes
dnvm upgrade

dnvm update-self

dnvm install 1.0.0-beta7 -r coreclr -arch ARM -u

dnvm install 1.0.0-beta7 -r coreclr -arch x86 -u

dnvm install 1.0.0-beta7 -r coreclr -arch x64 -u  

dnvm install 1.0.0-beta7 -r clr -arch x86 -u  

dnvm install 1.0.0-beta7 -r clr -arch x64 -u  

List runtimes

Powershell
List the runtimes installed in the development machine
dnvm list

yo

Powershell
Install yo and generator-aspnet using npm
npm install -g yo generator-aspnet
yo aspnet

dnvm use -v 1.0.0-beta7
dnu restore
dnx web  

PiController

C#
ASP.NET MVC Controller upon access retrieves the process usage of the pi
 namespace DnxPi.Controllers
{
    public class PiController : Controller
    {
	public IActionResult Index()
        {
            return View();
        }
    }
}  

dnu publish

Powershell
Publish the application for arm dnx pi
dnu publish --out C:\publish\DnxPi --no-source --runtime dnx-coreclr-win-arm.1.0.0-beta7 

Open port 5000 on Pi

Powershell
Enter the PsSession and open the port 5000 on the pi
Enter-PsSession -ComputerName minwinpc -Credential minwinpc\Administrator
Enter your password on propmt

netsh advfirewall firewall add rule name="DNX Web Server port" dir=in action=allow protocol=TCP localport=5000 

DnxPi

ASP.NET 5 application

Credits

Syed Sanoor

Syed Sanoor

3 projects • 98 followers
Developer

Comments