.NET Core on Raspberry Pi

原文地址:传送门

.NET Core on Raspberry Pi

Arm32 builds are available as community supported builds for .NET Core 2.0. There is no SDK that runs on ARM32 but you can publish an application that will run on a Raspberry Pi.

These steps have been tested on a RPi 2 and RPi 3 with Linux and Windows.

Note: Pi Zero is not supported because the .NET Core JIT depends on armv7 instructions not available on Pi Zero.

Creating an app:

  • Install .NET Core 2.0 SDK into a supported developer configuration. (Raspberry Pi itself is supported only as deployment target.)
  • From the terminal/commandline create a folder named helloworld and go into it.
  • Run dotnet new console
  • You can find a helloworld.csproj file is created under current directory.
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

</Project>
  • If you get restore errors, make sure you have a nuget.config file next to your csproj that includes the dotnet-core myget feed: <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
  </packageSources>
</configuration>
  • Run dotnet publish -r <runtime identifier> for example dotnet publish -r win-arm to publish the application for windows and dotnet publish -r linux-arm for Linux running on Raspberry Pi.
  • 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.

Getting the app to run on the Pi.

Linux

  • Install Linux on your Pi.
  • Install the platform dependencies from your distro‘s package manager for .NET Core.
  • Copy your app, i.e. whole publish directory mentioned above, to the Raspberry Pi and execute run ./helloworld to see Hello World! from .NET Core running on your Pi! (make sure you chmod 755 ./helloworld)

Win10 IoT Core

  • Install Windows 10 IoT Core on your Pi.
  • Copy your app, i.e. whole publish directory mentioned above, to the Raspberry Pi and execute run helloworld.exe to see Hello World! from .NET Core running on your Pi

原文地址:https://www.cnblogs.com/jiyang2008/p/8563555.html

时间: 2024-11-06 11:23:18

.NET Core on Raspberry Pi的相关文章

如何在Raspberry Pi 3B中安装Windows 10 IoT Core

Windows 10 IoT Core简介 Windows 10 IoT是微软专门为物联网生态打造的操作系统,Windows 10 IoT Core则是Windows 10 IoT 操作系统的核心版本,功能相对精简.使用Windows 10 IoT可以打造属于自己的物联网生态系统. Windows 10 IoT的版本介绍 Windows 10 IoT 企业版 Windows 10 IoT 企业版将 Windows 10 企业版功能广泛应用于零售.制造.医疗.金融和其他行业的设备上.Windows

[IOT] - Raspberry Pi 3B + Windows 10 IOT Core + .Net Core Web 部署

硬件:Raspberry Pi 3B 系统:Windows 10 IOT Core 应用:.Net Core Web 部署流程 1. 系统安装 1.1 下载并安装 Windows 10 IoT Core Dashboard,使用该工具将 Flash.FFU 映像文件刷入 SD 卡. https://docs.microsoft.com/en-us/windows/iot-core/downloads 1.2  Flash.FFU 映像刷入完成后,即可插入树莓派进行 Windows Iot 系统启

树莓派3(Raspberry Pi 3)安装Win10 IoT Core

·树莓派3(Raspberry Pi 3)安装Win10 IOT 1.格式化SD卡(用SDFormatter工具) 2.下载noobs lite即可(https://www.raspberrypi.org/downloads/noobs/),解压到SD卡中,启动Raspberry Pi 3 3.然后进入安装,先win10(或预览版,前提是Insiders体验者),安装过程有点慢,耐心等待(中途重启有可能得回头再重装) 4.安装完成后管理 Http://树莓派ip:8080 用户名:adminis

Raspberry Pi 3 with Openwrt

https://wiki.openwrt.org/toh/raspberry_pi_foundation/raspberry_pi#boot_log_raspberry_pi_3 Table of Contents Supported Versions Hardware Specifications Raspberry Pi SoCs Raspberry Pi Models Using I2C and SPI Power Notes Serial Boot Logs Boot Log (Rasp

Hijacking FM Radio with a Raspberry Pi &amp; Wire

转载:https://null-byte.wonderhowto.com/how-to/hack-radio-frequencies-hijacking-fm-radio-with-raspberry-pi-wire-0177007/ In our first part on software-defined radio and signals intelligence, we learned how to set up a radio listening station to find and

Raspberry Pi开发之旅-发送邮件记录时间及IP

由于我使用树莓派的场景大多数是在没有显示器.只用terminal连接它的情况下,所以,它的IP地址有时会在重启之后变掉(DHCP的),导致我无法通过terminal连接上它.然后我又要很麻烦地登录路由器的管理界面里,去看它被分配到的新IP是什么,然后用terminal重连,太麻烦了,不是么?作为一个树莓派玩家,这种麻烦简直是无法接受的! 为了解决这个问题,我让Pi开机的时候,自动向我指定的Email发送一封邮件,告诉我它此次开机时的IP地址. 步骤: 开机时执行一个脚本,检测网络可用性→网络通畅

Installing ROS Indigo on the Raspberry Pi

Description: This instruction covers the installation of ROS Indigo on the original Raspberry Pi with Raspbian.Keywords: Raspberry Pi, Setup, IndigoContents 1 Introduction This tutorial explains how to install ROS Indigo from source on the Raspberry

[quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming

[quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming http://blog.pi3g.com/2013/08/ffmpeg-gstreamer-raspberry-pi-windows-desktop-streaming/ This is a work still in progress with unsatisfactory results (image quality, delay, very low fram

在 Raspberry Pi安装Docker,运行Home Assistant

docker 是个好东西,想着Raspbian 是基于 Debian的系统,那定然是支持 docker的. 而有了docker,再raspberry pi上安装 Home Assistant就有了一种极其简单的方法. 1. 在Raspberry Pi 上安装docker curl -sSL https://get.docker.com | sh 参考:https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/ 2. 验证docke