【发布时间】:2017-08-16 23:15:46
【问题描述】:
SignalR Core pre-realease with ASP.net Core 2.0 in VS 2017 15.3 at runtime exception .. 无法加载文件或程序集 'System.Diagnostics.DiagnosticSource, Version=4.0.2.1
我在运行时而不是构建时遇到异常 抛出异常:Microsoft.AspNetCore.Hosting.dll 中的“System.IO.FileLoadException” Microsoft.AspNetCore.Hosting.dll 中出现“System.IO.FileLoadException”类型的未处理异常 无法加载文件或程序集“System.Diagnostics.DiagnosticSource,Version=4.0.2.1,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51”。找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)
出错的代码行是...
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
这里是运行后构建的日志文件的摘录 dotnet build -v d >build.log
Dependency "System.Diagnostics.DiagnosticSource, Version=4.0.2.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
Could not resolve this reference. Could not locate the assembly "System.Diagnostics.DiagnosticSource, Version=4.0.2.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
D:\org\projects> dotnet --version 2.0.0-preview2-006497
PackageReference Include="Microsoft.AspNetCore.SignalR" 版本="1.0.0-preview2-24707" PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-final"
【问题讨论】:
标签: asp.net-core signalr