当我使用System.Data.SqlClient版本4.4.3时无法加载文件或程序集System.Data.SqlClient,版本= 4.2.0.2 [英] Could not load file or assembly System.Data.SqlClient, Version=4.2.0.2 when I use System.Data.SqlClient Version 4.4.3

查看:52
本文介绍了当我使用System.Data.SqlClient版本4.4.3时无法加载文件或程序集System.Data.SqlClient,版本= 4.2.0.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将ASP.NET Core 2.0项目中的所有.NET Standard 2.0类库都使用System.Data.SqlClient版本4.4.3.为什么会得到

I use System.Data.SqlClient Version 4.4.3 for all .NET Standard 2.0 class libraries in my ASP.NET Core 2.0 project. Why do I get

无法加载文件或程序集'System.Data.SqlClient,版本= 4.2.0.2,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a'.找到的程序集的清单定义与程序集引用不匹配. (来自HRESULT的异常:0x80131040)

Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

何时使用VSTS将项目发布到Azure App Service?当然,它完全可以在我的机器上正常工作!

when the project is published with VSTS to Azure App Service? And of course it perfectly works on my machine!

昨天所有这些都奏效了.但是今天我决定将软件包更新为:

All this worked yesterday. But today I decided to update packages to:

<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" />

推荐答案

降级为

<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />

,一切又恢复正常!今天输了4个小时!!!

and everything works again! Lost 4 hours today!!!

这篇关于当我使用System.Data.SqlClient版本4.4.3时无法加载文件或程序集System.Data.SqlClient,版本= 4.2.0.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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