我正在尝试在Raspberry Pi上部署应用程序。我已经安装了.NET Core Runtime,执行时遇到此错误:
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
File name: 'System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices (Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions options, Microsoft.Extensions.DependencyInjection.ServiceCollection services) [0x0003f] in <e66a1f96e9734a7fac7cea0901022728>:0
at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache+<>c__DisplayClass4_0.<GetOrAdd>b__2 (System.Int64 k) [0x000fe] in <e66a1f96e9734a7fac7cea0901022728>:0
at (wrapper delegate-invoke) System.Func`2[System.Int64,System.ValueTuple`2[System.IServiceProvider,System.Collections.Generic.IDictionary`2[System.String,System.String]]].invoke_TResult_T(long)
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <69599a71bc4d4cd3a8a6e4323fa57b86>:0
at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd (Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions options, System.Boolean providerRequired) [0x000b7] in <e66a1f96e9734a7fac7cea0901022728>:0
at Microsoft.EntityFrameworkCore.DbContext..ctor (Microsoft.EntityFrameworkCore.DbContextOptions options) [0x00051] in <e66a1f96e9734a7fac7cea0901022728>:0
at Microsoft.EntityFrameworkCore.DbContext..ctor () [0x00006] in <e66a1f96e9734a7fac7cea0901022728>:0
at XPathParserTest1.Model..ctor () [0x00000] in <51b90b049f2c424c9ef8e7dced3213d4>:0
at XPathParserTest1.Program.MainAsync (System.String[] args) [0x001a2] in <51b90b049f2c424c9ef8e7dced3213d4>:0
at XPathParserTest1.Program.Main (System.String[] args) [0x00015] in <51b90b049f2c424c9ef8e7dced3213d4>:0
相同的项目文件在带有SDK的Windows上运行正常,而仅在运行时具有干净的Windows上运行。
我不知道发生了什么,我尝试了一些解决方法,包括编辑csproj文件和更改nuget依赖项。
答案 0 :(得分:0)
对于Raspbian,最好是为可执行文件生成本机映像,如果它得到官方支持