-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[BUG] System.Net.Http NuGet package .NET 4.6.1 assembly conflicts #27041
Comments
@ericstj can you help with this? |
/cc @AlexGhiondea It sounds to me like projects are inconsistently getting the support libs (4.2.0.0) vs the last package (4.1.2.0 from nuget package 4.3.3). I know @dsplaisted and @joperezr recently fixed some issues in the SDK around this type of issue. Without more information I can't pinpoint the problem. If possible can you share an isolated repro? |
I did some testing with a new project and here are the results: 1. Fresh .NET 4.6.1 project The weirdest part of it all is if I look at the .csproj file after step 2, this is what will be there:
and NOT the 4.2.0.0 path. I have no idea what's happening here. If, however, I install the Microsoft.Azure.DocumentDB package (which is the one I actually use), the standard 4.0.0.0 reference remains. I'm completely lost here. I keep getting conflicts with Net.Http dll since I have a dependency on Microsoft.Azure.DocumentDB package in a few of my projects (out of a total: 30+ solution). |
I'll explain what's going on.
That's because of the fix I mentioned above. Conflict resolution will prefer the one from Microsoft.NET.Build.Extensions because it is newer.
This is the IDE caching information. I think you may need to reload the project in order to see the change. If not it could be a bug with how Microsoft.NET.Build.Extensions is adding references /cc @dsplaisted. |
Thanks for the reply. I think what really confused me is why would just removing DocumentDB.Core dll (uninstalling the package) change the dependencies. Diffing the change, it literally just removes the dll reference from the project. So I'm trying to figure out the best way to solve this. From what I'm gathering, if I add ns1.6 assembly into all my projects and leave the "default" binding redirect of 4.2.0.0 resolve conflicts, in theory I'll be good? |
Hello, @ericstj, @davidsh! Since I've run into this problem, might I suggest updating the System.Net.Http package to include the 4.2.0.0 dll? This would make it easy to solve the problem by including this package in every project, at least it would be immediately obvious to users. I'm going ahead and closing the issue. |
I'm writing this in hope that it will be helpful to someone who has the same problem and doesn't have to waste 3 days like I did.
|
@rlreis90 im facing the same issue, could you please detail how you were able to fix it. |
@ericstj even though i have system.net.http.dll at C:\Program Files (x86)\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib. it is being picked up from packages. |
The assembly from Microsoft.NET.Build.Extensions is only referenced if needed as determined by https://github.com/dotnet/sdk/blob/6d67b5fde471245e0ed0a83e73517091d0728be2/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.NETFramework.targets#L24. If you feel you have an issue please open a new issue with full repro steps. There are many different problems that could cause issues related to loading of System.Net.Http. |
I'm still running into the infamous System.Net.Http NuGet package problem at this moment. Is a fix forthcoming?
I have several .NET 4.6.1 projects which require the System.Net.Http NuGet package (because of package dependency from Azure). If I simply add the package, I get the warning that conflicts occurred. The generated assembly redirects do not solve the issue.
Both of these do not work:
If I use this, the warnings disappear from most projects, but not all:
Anyone can help shed a light here?
Related:
dotnet/corefx#22781
#17770
The text was updated successfully, but these errors were encountered: