dependentAssembly being added by our NuGet package - not sure why?

Topics: Ecosystem
Feb 26, 2013 at 8:37 PM
Edited Feb 26, 2013 at 8:37 PM
I've got an internal NuGet package that is a .NET 4.5 assembly referencing System.Net.Http. When we install this package NuGet keeps adding the following:
    <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="" newVersion="" />
to the app.config - which then breaks the app because it should actually be using the .NET 4.0 version. I've tried adding this:
    <frameworkAssembly assemblyName="System.Net.Http" targetFramework=".NETFramework4.5">
to the NuSpec which then adds the System.Net.Http reference correctly (though it's not automatically needed), but I'm still getting the binding redirect added.

I've checked the assembly in dotPeek and while initially it was referencing both mscorlib v2 & 4 (as we had .NET 2 assemblies) I've stripped them out so it only references mscorlib v4 to no affect.

Any pointers? Thanks!
Feb 27, 2013 at 8:19 PM
Our logic for adding the binding redirect entry is quite aggressive and unfortunately there's not a way to turn it off. David Kean has filed an issue here ( Perhaps this will solve your problem?