c# - ASP.NET 错误:System.TypeLoadException 无法加载字段“Microsoft.Owin.Security.ActiveDirectory”的类型
问题描述
我从 git 存储库克隆了一个应用程序,该应用程序构建时没有错误和警告,但是当我运行该应用程序时,我收到以下错误:错误 500:System.TypeLoadException 无法加载字段类型“Microsoft.Owin.Security.ActiveDirectory”。 WsFedMetadataRetriever:CS$<>9__CachedAnonymousMethodDelegate5' (1) 由于:无法使用令牌 01000045 解析类型(来自 typeref、类/程序集 System.IdentityModel.Metadata.KeyDescriptor、System.IdentityModel、Version=4.0.0.0、Culture=neutral、 PublicKeyToken=b77a5c561934e089) 程序集:System.IdentityModel,版本=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089 类型:System.IdentityModel.Metadata.KeyDescriptor 成员:(null) 签名:
我试图通过将以下内容添加到 web.config 文件来解决此问题:
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
...但我仍然得到错误;我正在使用适用于 Mac 的 Visual Studio Community 2017。请问我能得到一些帮助吗?
解决方案
我更新了所有 Nuget 包,并安装了 Microsoft.ApplicationInsights.AspNetCore 它对我有用
推荐阅读
- scikit-learn - sklearn 自定义数据标准化
- python - 如何使用python反转字符串中每个字符的位
- node.js - 为什么即使 NPM_CONFIG_PRODUCTION 为真,也会跳过 devDependencies 的修剪?
- discord.js - 机器人加入公会后是否可以创建公会邀请链接?
- javascript - 交叉引用表上的 For 循环和 if 语句
- java - 在Java中锁定类的所有实例
- delphi - Delphi 10 Indy IdHttp如何在Task中实现OnWork
- c# - C# CUSTOM VKP80iii 出纸器/剪纸
- java - 如何通过用户输入向 sqlite 插入数据?
- android-espresso - java.lang.IllegalStateException:#init 连续调用了两次。确保在每个 #init 之后调用 #release