Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Framework binary contains reference to System.Net.Http 4.2.0.0 #2006

Open
jim-du opened this issue Apr 19, 2023 · 1 comment
Open

.NET Framework binary contains reference to System.Net.Http 4.2.0.0 #2006

jim-du opened this issue Apr 19, 2023 · 1 comment

Comments

@jim-du
Copy link

jim-du commented Apr 19, 2023

Describe the bug

M.D.SqlClient binaries that targets .NET Framework contain reference to library System.Net.Http 4.2.0.0, which is higher than the version included in the frameworks 4.0.0.0.

This is observed in library versions 3.1.3 by us, and 5.x according to #1834. However, in library version 2.1.5 the included reference was correctly System.Net.Http 4.0.0.0.

To reproduce

I have created this mini project to reproduce this issue. MDSMiniProject.zip It's essentially an empty C# console app that targets .NET Framework 4.6.2 and references M.D.SqlClient explicitly.

When building this project, it gives the following warning:

warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved.
warning MSB3277: There was a conflict between "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
warning MSB3277:     "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
warning MSB3277:     References which depend on "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Net.Http.dll].
warning MSB3277:         C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Net.Http.dll
warning MSB3277:           Project file item includes which caused reference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.Net.Http.dll".
warning MSB3277:             System.Net.Http
warning MSB3277:     References which depend on "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
warning MSB3277:         MDSMiniProject\Microsoft.Data.SqlClient.dll
warning MSB3277:           Project file item includes which caused reference "MDSMiniProject\Microsoft.Data.SqlClient.dll".
warning MSB3277:             Microsoft.Data.SqlClient

Expected behavior

The binaries should refer to System.Net.Http 4.0.0.0 so that it matches the minimum targeted framework version.

Further technical details

Microsoft.Data.SqlClient version: 3.1.3
.NET target: .NET Framewrk 4.6.2
SQL Server version: Azure SQL
Operating system: Windows 11

Additional context

Image showing 3.1.3 referencing 4.2.0.0:
image

Image showing 2.1.5 referencing 4.0.0.0:
image

Image showing the reference assembly included in .NET Framework 4.6.2:
image

@JRahnama JRahnama added this to Needs triage in SqlClient Triage Board via automation Apr 20, 2023
@JRahnama JRahnama moved this from Needs triage to Under Investigation in SqlClient Triage Board Apr 25, 2023
@JRahnama
Copy link
Member

@jim-du I was able to see that in your repro, but when I looked into installed packages Microsoft.Data.SqlClient was not installed properly. For test, just go to Tools>Nuget Package Manager>Manage Nuget Packages for Solution and reinstall v3.1.3. The warning wont come up. Let us know about the result. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
SqlClient Triage Board
  
Under Investigation
Development

No branches or pull requests

2 participants