【发布时间】:2021-01-13 13:15:35
【问题描述】:
我在 ASP.Net Core(4.6.1 框架)中有一个网络,它使用我用 Visual Studio 2015 创建并在昨天发布的新 Visual Studio 2017 中打开的 Facebook 和 MS 外部登录。 VS2017对csproj、project.json等文件做了一些改动。
网站编译和执行都很好,除了一个部分。如果我使用 Facebook 或 Microsoft 外部登录,该网站会显示此陷阱:
FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
System.Net.Http.WinHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
AggregateException: Unhandled remote failure.
Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler+<HandleRemoteCallbackAsync>d__6.MoveNext()
浏览器中的 url 显示它正在尝试从外部登录返回到本地(https://localhost:44321/signin-facebook?code=... 或 /signin-microsoft)。
System.Diagnostics.DiagnosticSource.dll(和 System.Net.Http.dll)的版本号是 4.6.24705.1。
我从头开始了一个新的 VS2017 项目,添加了 Facebook 和 MS 登录,它运行良好 - 让我在没有陷阱的情况下登录。 dll 的版本相同。
比较两个 csproj 文件显示了差异,但没有明显差异(与系统 dll 无关):
【问题讨论】:
-
你能分享一下项目文件的不同之处吗?某些东西可能会传递地引用该程序集。
-
添加了 csproj 差异的屏幕截图。
标签: authentication asp.net-core facebook-login visual-studio-2017