Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Commented Issue: NuGet should not generate binding redirects for binaries that are in the current framework [3072]

$
0
0
We're hitting an issue with Microsoft.Bcl package where NuGet is adding a binding redirect for a binary that is considered part of the framework, this causes the application to crash because the binding redirect refers to assembly version that is not available at runtime.

@Repro:

1. Create a new Console Application targeting 4.5
2. Create a new Portable Library targeting .NET Framework 4.5, Silverlight 4, Windows Phone 7.5 and .NET for Windows Store apps
3. Add a reference to the portable library from the Console Application
4. Install the Microsoft.Bcl package (1.0.16-rc) to both projects

@Expected: No binding redirect for System.Runtime in the .NET Framework 4.5 project because a ___later version___ is part of the target framework (see C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\RedistList\FrameworkList.xml)
@Actual: Binding redirect

<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" />
</dependentAssembly>


You can use the IVsFrameworkMultiTargeting to determine if a given assembly version is available as part of a given target framework.
Comments: I'm chasing up the repro with Eric St. John. He walked through the code and figured out where it was broken. It's the not the app.config.tranform, notice how the net45 content is empty, and hence no transforms. We also marked our transforms with a special marker that indicates that we added the redirects . The binding redirects we were seeing were not coming from us.

Viewing all articles
Browse latest Browse all 7612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>