I am seeing this warning while building my solution -
The explicit binding redirect on "System.Net.Http, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" conflicts with an autogenerated
binding redirect. Consider removing it from the application configuration file or disabling autogenerated binding redirects. The build will replace it with: "<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" xmlns="urn:schemas-microsoft-com:asm.v
1" />"
I have to use different version of System.Net.Http version 4.1.1.3 not 4.2.0.0 which I've explicitly mentioned in the App.config file. But due to AutoGenerateBindingRedirects flag, it's redirecting it to 4.2.0.0. [When I use 4.2.0.0 version, I am getting Runtime Exception while createing HttpClient. It works fine with version 4.1.1.3. Error-Message : Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
.]
.Net framework - 4.6.2
Q1. Is there any way to override the binding redirects which got generated via AutoGenerateBindingRedirects (as App.Config binding redirects are not working)? If yes, How?
Q2. How does AutoGenerateBindingRedirects flag decide which version a particular assembly has to redirect ? (like why System.Net.Http is being redirected to 4.2.0.0 not any other version)
Thanks in advance!!