This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 430
A package referencing just NETStandard causes invalid binding redirects on .NET 4.7.2 in a web application #941
Comments
I'm pretty sure that this is the same issue that you logged here #887. It might be caused by referencing a different package, but the same issue is happening underneath. That is that NuGet package manager will add wrong binding redirects into your App.config. As suggested in the other issue, a workaround for this is to instead use PackageReference instead of using the default NuGet package manager. |
We closed that one because the issue is external. We have an internal issue with NuGet package manager that is tracking this, but if you’d like to be able to track the progress for that, you could log a github issue at nuget/home repo. |
@joperezr Thank you, I have done that (NuGet/Home#7440). |
This was referenced Nov 20, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
There seems to be an issue that adds bad binding redirects to web.config and it also leads to System.Net.Http being erroneously installed. I'm not sure with my diagnosis here but there seems to be some issue. This issue uses the UAParser NuGet package but UAParser is not at fault. It merely references NETStandard so I'm using this package to demonstrate the issue. This is on .NET 4.7.2, VS 15.8.7, Windows 7.
The core of the repro is this:
The app crashes like this:
In the web.config file there are binding redirects like this one:
If this one and a few others are commented out the app runs. The redirects appear inappropriate because they do not specify the version number that is installed on the machine (4.0.0.0 I believe).
I also note that System.Net.Http was installed. According to this comment this should not be done. So I manually uninstalled it, deleted bin/obj, commented in the binding redirects and tested. This did not change anything.
I'm not sure what exactly is broken here but I do not believe that UAParser does anything wrong here. It only references NETStandard which can't be wrong according to my understanding.
We are experiencing this issue in a production application. This forces us to manually undo the faulty binding redirects after NuGet operations.
BindingRedirectsRepro.zip
The text was updated successfully, but these errors were encountered: