Build Conflict between System.Net.Http-Package & Framework-Default Assembly #673

Open
opened 2025-12-29 08:32:22 +01:00 by adam · 4 comments
Owner

Originally created by @smdbiel on GitHub (Mar 4, 2025).

Originally assigned to: @StefH on GitHub.

Context

Net-Framework (4.8.1)
Wiremock uses a PackageReference to Nuget Package "System.Net.Http" in Version 4.3.4

System.Net.Http-Package
NugetPackage Version: 4.3.4 (Current and newest)
Actual Assembly version sinde: 4.1.1.3

System.Net.Http Assembly included in GAC in Net-Framework 4.8
Assembly Version: 4.2.0.0

Describe the bug

Setup:

  • Main Project with implicit GAC/System-Assembly usage (=4.2.0.0)
  • Unit Test Project with WireMock which adds implicit reference to Package 4.3.4 (=4.1.1.3 as actual assembly Version)
  • A Unit Tests exists wich uses and exchanges a type from System.Net.Http with the tested Main Project

Result:

  • Build of Test-project fails because of conflict (CSC: Error CS1705)
  • Implicitly referenced System.Net.Http in Test-Project can't be explicitly upgraded because no NugetPackage-Version exists with a version as high as the Framework-provided version

Expected behavior:

  • Should be possible to build without downgrading the System.Net.Http-Assembly version in den Main Project
  • Is a reference to System.Net.Http-Package necessary when a newer Framework provided Assembly exists in GAC for 4.8?

Things that did not work as a workaround:

  • Assembly Redirect/Rebinding
  • Not exposing internal References with PrivateAssets
  • Trying to explicitly add the System-Assembly in Test Project
  • Trying to skip the implicit inclusion of the Package in Test-Project
Originally created by @smdbiel on GitHub (Mar 4, 2025). Originally assigned to: @StefH on GitHub. ### Context Net-Framework (4.8.1) Wiremock uses a PackageReference to Nuget Package "System.Net.Http" in Version 4.3.4 **System.Net.Http-Package** NugetPackage Version: 4.3.4 (Current and newest) Actual Assembly version sinde: 4.1.1.3 **System.Net.Http Assembly included in GAC in Net-Framework 4.8** Assembly Version: 4.2.0.0 ### Describe the bug Setup: - Main Project with implicit GAC/System-Assembly usage (=4.2.0.0) - Unit Test Project with WireMock which adds implicit reference to Package 4.3.4 (=4.1.1.3 as actual assembly Version) - A Unit Tests exists wich uses and exchanges a type from System.Net.Http with the tested Main Project Result: - Build of Test-project fails because of conflict (CSC: Error CS1705) - Implicitly referenced System.Net.Http in Test-Project can't be explicitly upgraded because no NugetPackage-Version exists with a version as high as the Framework-provided version ### Expected behavior: - Should be possible to build without downgrading the System.Net.Http-Assembly version in den Main Project - Is a reference to System.Net.Http-Package necessary when a newer Framework provided Assembly exists in GAC for 4.8? ### Other related info Things that did not work as a workaround: - Assembly Redirect/Rebinding - Not exposing internal References with PrivateAssets - Trying to explicitly add the System-Assembly in Test Project - Trying to skip the implicit inclusion of the Package in Test-Project
adam added the bug label 2025-12-29 08:32:22 +01:00
Author
Owner

@StefH commented on GitHub (May 2, 2025):

@smdbiel

Can you please a complete example project which shows this error?

@StefH commented on GitHub (May 2, 2025): @smdbiel Can you please a complete example project which shows this error?
Author
Owner

@StefH commented on GitHub (Jun 28, 2025):

@smdbiel

Can you please a complete example project which shows this error?

@StefH commented on GitHub (Jun 28, 2025): @smdbiel Can you please a complete example project which shows this error?
Author
Owner

@StefH commented on GitHub (Jul 20, 2025):

@smdbiel

Can you please a complete example project which shows this error?

@StefH commented on GitHub (Jul 20, 2025): @smdbiel Can you please a complete example project which shows this error?
Author
Owner

@StefH commented on GitHub (Oct 5, 2025):

@smdbiel

Can you please a complete example project which shows this error?

@StefH commented on GitHub (Oct 5, 2025): @smdbiel Can you please a complete example project which shows this error?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#673