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

Consider removing reference to System.Net.Http NuGet package #1552

Closed
OronDF343 opened this issue Aug 8, 2023 · 3 comments · Fixed by #1830
Closed

Consider removing reference to System.Net.Http NuGet package #1552

OronDF343 opened this issue Aug 8, 2023 · 3 comments · Fixed by #1830
Assignees

Comments

@OronDF343
Copy link

I'm considering using Refit in an environment with both .NET 6.0 and legacy .NET Framework services. However, I noticed that Refit has a reference to System.Net.Http 4.3.4. Transitive references to this package in .NET Framework projects have caused us major headaches in the past. The official recommendation is to avoid referencing the package.

While most issues are not present in .NET Framework 4.7.2 and SDK-style projects, this is not always the case with older projects. For example, in Web Site projects, the outdated version of System.Net.Http as well as outdated version of many other runtime libraries such as System.IO are copied to the Bin folder by default. This can and will break user code that depends on .NET Framework 4.7.2 behavior, such as HttpClientHandler.SslProtocols, which throws an exception in the older versions.

As for why Refit references it in the first place, I found this issue but it seems to be unrelated to the functioning of Refit, instead having to do with some broken build system.

Please consider removing the reference.

@adcorduneanu
Copy link

Any update on this one? I'm facing issues with Refit and other involved projects because of this dependency

@ChrisPulman
Copy link
Member

System.Net.Http.Json has been removed from non .NetFramework and .NetStandard versions as a first step, I will check the reason for the System.Net.Http reference being there

Copy link

github-actions bot commented Oct 5, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants