asp.net-mvc - 在 Azure 上部署后无法加载文件或程序集“System.IdentityModel.Tokens.Jwt”

标签 asp.net-mvc azure web-deployment

我的 Web 应用程序在本地主机上运行良好,但是当我将其发布到 Azure 上时,出现以下错误:

Could not load file or assembly 'System.IdentityModel.Tokens.Jwt' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

在本地主机上工作正常。

我使用的是4.5框架,它也在web.config文件中定义。我尝试在 nuget 管理器中重新安装它,但我得到

Package 'System.IdentityModel.Tokens.Jwt.4.0.2.206221351' already exists in project 'project1'

我也无法在引用文件夹中找到此程序集。 这是我第一次遇到此类问题。

你建议我做什么?

问候, 桑迪

最佳答案

Azure Functions 主机中存在一个已知问题:https://github.com/Azure/azure-functions-host/issues/5894

当前的解决方法是将以下内容添加到您的 .csproj:

<PropertyGroup>
  <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>

关于asp.net-mvc - 在 Azure 上部署后无法加载文件或程序集“System.IdentityModel.Tokens.Jwt”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36687538/

相关文章:

c# - 局部 View 不刷新

javascript - ASP.NET MVC 3 - Ajax 更新表 - 模型

c# - 在 EF6 中将匿名类型转换为 IEnumerable<>

c# - 如何在mvc中映射多个路由

azure - 如何将此重复的 Azure DevOps 步骤拆分为可重用模板

azure - 从 Azure VM 中删除首选 DNS

azure - 如何设置默认 Azure 目录

node.js - 多少个提取请求过多?

.net - 错误 CS1705 : "which has a higher version than referenced assembly"

java - gwt 使用 guice - 引导或部署时发生的情况