【问题标题】:ASP.NET Error: System.TypeLoadException Could not load type of field 'Microsoft.Owin.Security.ActiveDirectoryASP.NET 错误:System.TypeLoadException 无法加载字段“Microsoft.Owin.Security.ActiveDirectory”的类型
【发布时间】:2019-02-21 18:27:14
【问题描述】:

我从 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, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.IdentityModel.Metadata.KeyDescriptor 成员:(空)签名:

我尝试通过将以下内容添加到 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。请问我能得到一些帮助吗?

【问题讨论】:

  • 您是否发现项目中列出的依赖项存在问题?我怀疑您缺少图书馆或图书馆过时。

标签: c# asp.net


【解决方案1】:

我更新了所有 Nuget 包,并安装了 Microsoft.ApplicationInsights.AspNetCore 它对我有用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-28
    • 2016-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多