有趣的依赖问题...
VS2015.3、.NET45 将 Microsoft.Owin 从 3.0.0 更新到 3.0.1(跟踪此更新是问题所在 - 想要安装 https://www.nuget.org/packages/IdentityServer3.AccessTokenValidation/)
但发布到 Azure 网站:(我直接从 VS 删除 azure 上目标位置的其他文件)。重新启动并删除了 Azure Web 服务器上的所有文件。
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(小心)
然后重建
最佳答案
我也在这上面浪费了几个小时,因为尽管 nuget 包被标记为 3.0.1,但 nuget 安装的引用版本为 3.0.0
使旧版本比新版本更新解决了我的问题:
<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>
*编辑:我认为(但不确定)我的版本仍然是 3.0.0.0 的原因是因为 bin 文件夹被我的存储库捕获并且 nuget 不想覆盖 dll
关于c# - 无法加载文件或程序集 Microsoft.Owin 3.0.0 到 3.0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39276347/