无法加载文件或程序集Microsoft.Owin 3.0.0至3.0.1 [英] Could not load file or assembly Microsoft.Owin 3.0.0 to 3.0.1

查看:30
本文介绍了无法加载文件或程序集Microsoft.Owin 3.0.0至3.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有趣的依赖问题...

VS2015.3,.NET45将Microsoft.Owin从3.0.0更新到3.0.1(跟踪此更新是问题-想要安装它可以在IIS Express上本地工作

但发布到Azure网站:(从VS上直接从Azure上删除目标位置上的其他文件).重新启动并从azure网站服务器上删除了所有文件.

web.config的翻译看起来还可以

 < dependentAssembly>< assemblyIdentity name ="Microsoft.Owin" publicKeyToken ="31bf3856ad364e35" culture ="neutral"/>< bindingRedirect oldVersion ="0.0.0.0-3.0.1.0" newVersion ="3.0.1.0"/></dependentAssembly> 

修改Bruce Chen的回答向我指明了Kudu(Azure-开发工具,高级工具)的方向

我下载了Owin dll,它是错误的版本,即3.0.0

要解决此问题,我从解决方案中清除了所有程序包工件

git clean -xfd(请小心)

然后重建

解决方案

无法加载文件或程序集"Microsoft.Owin,版本= 3.0.1.0,区域性=中性,PublicKeyToken = 31bf3856ad364e35"或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.

通常,这意味着.NET程序集加载器找不到具有所引用特定版本的程序集.请确保可以在您的Azure网站上找到版本为3.0.1.0的程序集,并且该版本通过KUDU或FTP客户端与web.config中的定义匹配.

正如您所说,它可以在IIS Express上本地运行,请尝试通过KUDU或FTP客户端将您的网站内容手动部署到Azure,并确定它是否可以工作.

Interesting dependency issue...

VS2015.3, .NET45 updating Microsoft.Owin from 3.0.0 to 3.0.1 (traced this update to be the problem - wanting to install https://www.nuget.org/packages/IdentityServer3.AccessTokenValidation/)

it works locally on IIS Express

but publish to Azure website: (am removing additional files at destination on azure publish straight from VS). restarted and deleted all files from azure webserver too.

web.config translation looks okay

<dependentAssembly>
   <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
   <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />   
</dependentAssembly>

Edit Bruce Chen's answer pointed me in the direction of Kudu (Azure - Development Tools, Advanced Tools)

I downloaded the Owin dll, and it was the wrong version ie 3.0.0

To fix I cleared out all package artifacts from my solution

git clean -xfd (be careful)

Then rebuilt

解决方案

Could not load file or assembly 'Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

In general, this means that the .NET Assembly loader could not find the assembly with specific version that was referenced. Please make sure this assembly with version 3.0.1.0 could be found in your Azure website and the version matches the definition in your web.config via KUDU or FTP client.

As you said, it works locally on IIS Express, please try to deploy your website content manually to Azure via KUDU or FTP client and find out whether it works or not.

这篇关于无法加载文件或程序集Microsoft.Owin 3.0.0至3.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆