当我使用 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
问题描述
我将 System.Data.SqlClient 版本 4.4.3 用于我的 ASP.NET Core 2.0 项目中的所有 .NET Standard 2.0 类库.为什么我得到
<块引用><块引用>无法加载文件或程序集System.Data.SqlClient,版本=4.2.0.2,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a".定位的程序集的清单定义与程序集引用不匹配.(来自 HRESULT 的异常:0x80131040)
项目何时使用 VSTS 发布到 Azure 应用服务?当然,它在我的机器上完美运行!
昨天所有这些都奏效了.但是今天我决定将软件包更新为:
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" 版本="2.0.3"/>
降级为
一切又正常了!今天损失了 4 个小时!!!
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
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)
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" />
Downgraded to
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
and everything works again! Lost 4 hours today!!!
这篇关于当我使用 System.Data.SqlClient 版本 4.4.3 时,无法加载文件或程序集 System.Data.SqlClient,版本 = 4.2.0.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!