Referencing NETStandard1.5 / NETStandard1.6 library in NET461 project gets wrong facades
See original GitHub issueSee https://github.com/dotnet/core/issues/730#issuecomment-313152425.
Related: https://github.com/dotnet/corefx/issues/19058
The netstandard mapping for net461
changed from netstandard1.4
to netstandard2.0
and NET462 changed from netstandard1.5
to netstandard2.0
.
This causes a ref-def mismatch for our old packages, consider System.Runtime:
- netstandard1.0 : 4.0.0.0
- netstandard1.2 : 4.0.10.0
- netstandard1.3 : 4.0.20.0
- netstandard1.5 : 4.1.0.0
- net45 : 4.0.0.0
- net451 : 4.0.10.0
- net46 : 4.0.20.0
- net462 : 4.1.0.0
A library compiled against netstandard1.5
would get a reference to assembly version 4.1.0.0. Prior to the NuGet change that library would only run on net462 or later, where the package also carried a facade with the same version. After the NuGet change its a problem because the package only provides the 4.1.0.0 facade for net462
and higher.
@terrajobst, @weshaggard, and I had thought about this and planned for it by having the netstandard2.0 support package supersede those older netstandard constituent packages (see related issue). The idea was the netstandard2.0 support package would be applicable in all cases where it mattered. The problem was I later did an optimization that only applies the ns2 support libs when netstandard.dll is referenced.
The fix here, will be to instead apply the netstandard support libs whenever netstandard.dll or System.Runtime 4.1.0.0 (or later) is referenced.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
You’ll get that error if your web app is missing bindingRedirects. @nguerrera reccomended a good solution here: https://developercommunity.visualstudio.com/solutions/98340/view.html
@ericstj That’s great, thanks! Finding the warning in the Error List pane and double-clicking on it did the trick for me, and all the binding redirects were added to my Web.Config file.