zoukankan      html  css  js  c++  java
  • .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 .inDebug etcoreapp2.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

  • 相关阅读:
    LeetCode:2. 两数相加
    LeetCode:1. 两数之和
    property类的使用
    JAVA-数据库连接【转】
    快速将excel数据保存到Oracle数据库中【转】
    Oracle导入excel数据方法汇总[转]
    Maven 系列 一 :Maven 快速入门及简单使用【转】
    Maven 系列 二 :Maven 常用命令,手动创建第一个 Maven 项目【转】
    开源项目导入eclipse的一般步骤[转]
    JavaScript基础---作用域,匿名函数和闭包【转】
  • 原文地址:https://www.cnblogs.com/jiyang2008/p/8563555.html
Copyright © 2011-2022 走看看