您可以使用.NET Core的可移植linux-arm运行时版本.
在您的构建计算机上,确保dotnet –version返回2.0,预览版或更高版本(在撰写本文时:2.0.0-preview1-005977).
> dotnet new mvc
> dotnet restore -r linux-arm
> dotnet publish -r linux-arm / p:MvcRazorCompileOnPublish = false
>将bin / Debug / netcoreapp2.0 / linux-arm / publish的内容复制到目标计算机并使用./nameOfTheProject运行
既然您可能也希望在本地开发,那么您需要编辑这样的项目(.csproj)文件(< PropertyGroup>):
linux-arm
true
这样,您可以在开发期间使用dotnet还原,dotnet运行和dotnet发布,也可以在没有其他参数的情况下使用其他部署,并且在准备部署到arm时,只能使用:
dotnet publish -c Release -r linux-arm
并使用bin / Release / netcoreapp2.0 / linux-arm / publish中生成的二进制文件(或传递一个额外的-o ../publish-output参数)