简体   繁体   English

无法加载文件或程序集 Microsoft.Owin 3.0.0 到 3.0.1

[英]Could not load file or assembly Microsoft.Owin 3.0.0 to 3.0.1

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/ ) VS2015.3, .NET45 将 Microsoft.Owin 从 3.0.0 更新到 3.0.1(跟踪此更新是问题-想要安装https://www.nuget.org/packages/IdentityServer3.AccessTokenValidation/

在此处输入图片说明 it works locally on IIS Express它在 IIS Express 上本地工作

but publish to Azure website: (am removing additional files at destination on azure publish straight from VS).但发布到 Azure 网站:(我正在从 VS 直接删除 azure 发布目标上的其他文件)。 restarted and deleted all files from azure webserver too.重新启动并删除了 azure webserver 中的所有文件。

在此处输入图片说明

web.config translation looks okay 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>

Edit Bruce Chen's answer pointed me in the direction of Kudu (Azure - Development Tools, Advanced Tools)编辑Bruce Chen 的回答为我指明了 Kudu(Azure - 开发工具、高级工具)的方向

在此处输入图片说明

I downloaded the Owin dll, and it was the wrong version ie 3.0.0我下载了 Owin dll,它是错误的版本,即 3.0.0

To fix I cleared out all package artifacts from my solution为了修复我从我的解决方案中清除了所有包工件

git clean -xfd (be careful) git clean -xfd(小心)

Then rebuilt然后重建

I wasted a couple of hours on this too because the reference installed by nuget had version 3.0.0 despite the nuget package being labelled 3.0.1我也浪费了几个小时,因为 nuget 安装的参考版本为 3.0.0,尽管 nuget 包被标记为 3.0.1

Making the old version newer than the new version fixed my problem:使旧版本比新版本更新解决了我的问题:

 <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: I think(but not certain) that the reason my version was still 3.0.0.0 was because the bin folder got caught in my repo and nuget didn't want to write over the dll *编辑:我认为(但不确定)我的版本仍然是 3.0.0.0 的原因是因为 bin 文件夹被我的 repo 捕获并且 nuget 不想覆盖 dll

It requires a new version instead of the one that you currently have.它需要一个新版本,而不是您当前拥有的版本。 If you are using Visual Studio right click the project --> Manage NuGet Packages --> Updates --> select the Owin nuget --> Click "Update".如果您使用的是 Visual Studio,请右键单击项目 --> 管理 NuGet 包 --> 更新 --> 选择 Owin nuget --> 单击“更新”。 As of today, the latest version is 4.0.0.截至今天,最新版本是 4.0.0。 Hope it works out fine!希望效果很好!

Could not load file or assembly 'Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.无法加载文件或程序集“Microsoft.Owin,版本=3.0.1.0,文化=中性,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。 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.通常,这意味着 .NET 程序集加载器无法找到具有引用的特定版本的程序集。 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.请确保可以在您的 Azure 网站中找到此版本为 3.0.1.0 的程序集,并且该版本与您通过 KUDU 或 FTP 客户端在 web.config 中的定义相匹配。

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.如您所说,它在 IIS Express 本地运行,请尝试通过 KUDU 或 FTP 客户端手动将您的网站内容部署到 Azure 并查看它是否有效。

Just to comment here that I saw this type of error when I upgraded to 4.1.0.0 and my issue was on Web.config where I still had 4.0.1.0.只是在这里评论一下,当我升级到 4.1.0.0 时我看到了这种类型的错误,我的问题出在 Web.config 上,而我仍然有 4.0.1.0。 So, what you have in .csproj should match what is in Web.config.因此,您在 .csproj 中的内容应该与 Web.config 中的内容相匹配。 Updating or reinstalling did nothing in my case until I synced up the version numbers.在我同步版本号之前,更新或重新安装对我来说没有任何作用。

In the NuGet Package Manager, check the version of Microsoft.Owin installed.在 NuGet 包管理器中,检查安装的 Microsoft.Owin 的版本。 Then update you project folder's web.config file, search for Microsoft.Owin in web.config and change "newVersion" to your NuGet Package Manager Version.然后更新您项目文件夹的 web.config 文件,在 web.config 中搜索 Microsoft.Owin 并将“newVersion”更改为您的 NuGet 包管理器版本。 This worked for me.这对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行时错误:无法加载文件或程序集&#39;Microsoft.Owin,版本= 3.0.0.0…Azure移动服务 - Runtime error: Could not load file or assembly 'Microsoft.Owin, Version=3.0.0.0…Azure mobile services 无法加载文件或程序集“Microsoft.Owin,版本=3.0.1.0,文化=中性,PublicKeyToken=31bf3856ad364e35” - Could not load file or assembly 'Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 无法加载文件或程序集“Microsoft.Owin,版本=2.1.0.0,文化=中性,PublicKeyToken=31bf3856ad364e35 - Could not load file or assembly 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 EF 更新数据库生成错误“无法加载文件或程序集 'Microsoft.Owin,版本 = 3.0.1.0” - EF Update-database generating error "Impossible to load the file or the assembly 'Microsoft.Owin, Version=3.0.1.0" 无法加载文件或程序集 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 或其依赖项之一 - Could not load file or assembly 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies &#39;Microsoft.Owin&#39;上的FileLoadException - FileLoadException on 'Microsoft.Owin' 找不到引用的组件“ Microsoft.Owin”,“ Microsoft.Owin.Security”,“ Microsoft.Owin.Security.Facebook”吗? - The referenced component 'Microsoft.Owin', 'Microsoft.Owin.Security', 'Microsoft.Owin.Security.Facebook' could not be found? 无法安装软件包“ Microsoft.Owin 4.0.0”。 我无法将Microsoft.Owin软件包安装到.NETFramework项目中吗? - Could not install package 'Microsoft.Owin 4.0.0'. Am I not able to install Microsoft.Owin packages into a .NETFramework project? 无法加载文件或程序集Microsoft.Owin.Security.OAuth,Version = 2.0.0.0 - Could not load file or assembly Microsoft.Owin.Security.OAuth, Version=2.0.0.0 Microsoft.Owin.Host.SystemWeb 导致无法加载文件或程序集“System.Runtime” - Microsoft.Owin.Host.SystemWeb results in Could not load file or assembly 'System.Runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM