在 ARM 处理器(Raspberry Pi 3 B)/Ubuntu(原生没有 Mono)上运行 ASP.Net Web 应用程序时出错 [英] Error in running ASP.Net Web App on ARM processor (Raspberry Pi 3 B) / Ubuntu (Natively without Mono)
问题描述
我按照下面的指南在我的 ubuntu 机器上运行了一个简单的 C#
控制台程序,一切都很顺利.(我正在尝试使用 .Net Core
本地运行所有内容,而不使用任何 Mono
!)
I followed the guide bellow to run a simple C#
console program on my ubuntu box, and everything went smoothly. (I am trying to run everything natively using .Net Core
without any usage of Mono
!)
指南:https://github.com/dotnet/core/blob/master/样品/RaspberryPiInstructions.md
但是当我这样做时,尝试运行 ASP.Net Web 应用程序
(由 Visual Studio 生成的非常基本和简单的模板),我收到此错误:
But when I did the same, trying to run an ASP.Net web application
(the very basic and simple template generated by Visual Studio), I get this error:
root@dotnet:/dotnet/aspnetcore/PublishOutput# /dotnet/dotnet WebApplication1.dll
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.ComponentModel.Primitives, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Microsoft.Extensions.FileProviders.PhysicalFileProvider.CreateFileWatcher(String root)
at Microsoft.AspNetCore.Hosting.Internal.HostingEnvironmentExtensions.Initialize(IHostingEnvironment hostingEnvironment, String applicationName, String contentRootPath, WebHostOptions options)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildHostingServices()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at WebApplication1.Program.Main(String[] args)
Aborted (core dumped)
有人可以帮助我解决这个问题并在我的 RPi3 上本地运行 ASP.Net 应用程序吗?
附言我不认为这很重要,但我在 Docker
容器中工作.
P.S. I don't think this is important, but I am working in Docker
container.
推荐答案
GitHub 上有人找到了解决方案!!非常感谢他.实际上这是一种变通方法,直到我们可以直接在 ARM 上构建应用程序或找到另一个真正的解决方案,但这种变通方法现在非常有效!
Some one on GitHub found the solution!! big thanks to him. Actually it is a workaround till we can build the app on ARM directly or find another real solution, but this workaround works very good now!
https://github.com/dotnet/coreclr/issues/9168#issuecomment-277846829
这篇关于在 ARM 处理器(Raspberry Pi 3 B)/Ubuntu(原生没有 Mono)上运行 ASP.Net Web 应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!