简体   繁体   English

Visual Studio升级到2017 15.5.3打破了解决方案

[英]Visual Studio upgrade to 2017 15.5.3 breaks solution

I have a webapi in dotnet core 2.0, from which I reference an old dll (.net 3.5) for the main purpose of data access to a database. 我在dotnet core 2.0中有一个webapi,从中我引用了一个旧的dll(.net 3.5),主要目的是对数据库的数据访问。 Everytime I run the solution I am having 每当我运行解决方案时

System.IO.FileLoadException: 'Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. System.IO.FileLoadException:'无法加载文件或程序集'System.Data.SqlClient,版本= 4.2.0.1,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a'。 The located assembly's manifest definition does not match the assembly reference. 找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040)' (来自HRESULT的异常:0x80131040)

Everything was working fine before the VS update to version 15.5.3 在VS更新到15.5.3版之前,一切工作正常

I had the same problem with my webapi (also netcoreappp2.0) and VS2017 15.5.3. 我的webapi(也是netcoreappp2.0)和VS2017 15.5.3遇到了相同的问题。

API is using ADO connections with "Systam.Data.SqlClient" provider. API正在通过“ Systam.Data.SqlClient”提供程序使用ADO连接。 What I did is installation Systam.Data.SqlClient package from NuGet (ver. 4.4.2). 我所做的是从NuGet(版本4.4.2)安装Systam.Data.SqlClient软件包。 After this the exception ceased to be thrown. 在此之后,异常不再被抛出。

I got this error while using a net standard 2.0 lib inside a project. 我在项目中使用网络标准2.0库时收到此错误。 I finally discovered a bad format error. 我终于发现了一个错误的格式错误。 Made sure the project platform matched in my case x64. 确保项目平台在我的案例x64中匹配。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM