是否可以在Raspberry PI上运行.NET Core?

TN.*_*TN. 40 raspberry-pi .net-core

我听说.NET Core也可以在Linux和Mac上运行.我目前在Raspberry PI上使用Mono.是否可以或者可以在Raspberry PI上运行.NET Core?

TN.*_*TN. 15

我已经设法使用Raspbian在Raspberry PI 3上运行.NET Core 2应用程序.

我关注了https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.mdhttps://github.com/dotnet/core/issues/447:

在我的笔记本上:

安装.NET Core 2.0 SDK

mkdir helloworld
cd helloworld
dotnet new console
Run Code Online (Sandbox Code Playgroud)

编辑 helloworld.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <RuntimeIdentifiers>win-arm;linux-arm</RuntimeIdentifiers>
  </PropertyGroup>

</Project>
Run Code Online (Sandbox Code Playgroud)

dotnet publish -r linux-arm
Run Code Online (Sandbox Code Playgroud)

在Raspberry PI 3上使用Raspbian:

sudo apt-get install libc6 libcurl3 libgcc1 libgssapi-krb5-2 libicu52 liblttng-ust0 libssl1.0.0 libstdc++6 libunwind8 libuuid1 zlib1g

然后./bin/Debug/netcoreapp2.0/linux-arm/publish从我的笔记本电脑复制

[修改权限helloworld]

./helloworld


Adi*_*Adi 8

现在,您可以在Raspberry PI上运行dotnet核心.为此,您需要:

  1. 交叉编译coreclr和corefx(可能在Linux x64机器上)
  2. 在没有私有和预编译文件的情况下将dll提取到PI
  3. 将应用的托管dll复制到PI
  4. 使用"corerun"可执行文件来运行您的应用程序

如果你想跳过上面的内容并获得Raspberry PI 3(甚至是整个图像)的现成二进制文件,你可以使用我编译的版本:

http://ravendb.net/promo/xmas-win-raspberry-pi

注意:我能够在Raspberry PI 3上使用Headless Ubuntu Server 16.04和Ubuntu Mate 16.04.我假设需要在Raspbian OS和PI 2上完成额外的步骤(即安装额外的软件包).

交叉编译的链接(在Ubuntu 16.04 x64机器上):

我用"如何"获取二进制文件(包括我们的应用程序)制作的视频:

https://www.youtube.com/watch?v=DPxCVDOUlT8

  • @TN如果你不喜欢它(问题属于你) - 我可以删除它(没有伤害的感觉),你可以继续在其他地方的RPI上寻找一个工作的dotnet核心. (3认同)

joh*_*yno 7

现在或很快它将成为可能,因为微软宣布 CoreCLR可以在GitHub上使用.

今天,.NET Core在Windows上构建并运行.我们将在未来几个月内添加特定于平台的组件的Linux和Mac实现.我们已经在.NET Core中有一些特定于Linux的代码,但我们真的只是开始使用我们的端口.我们想先打开代码,这样我们才能从一开始就享受跨平台的旅程.

  • @TN:哈哈,还在等,我们已经到了2016年底......可悲的是,它需要太多的空间来在我的Chromebook上编译它... (4认同)

小智 6

我会发表评论,但因为我不能发布作为答案,我认为应该更新已接受的答案.因为现​​在可以检查coreclr https://github.com/dotnet/coreclr/pull/1210

这完全是社区的努力,虽然这仍然非常粗糙(异常处理和调试尚未得到支持),所以你不能把它作为一个解决方案,但最终它会到达那里.日期:2015年7月26日