-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Referencing NETStandard1.5 / NETStandard1.6 library in NET461 project gets wrong facades #1386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ericstj is this a change that you can make? |
Yeah, I can get a PR ready. I'll need some help getting it in though. |
I can help with that. Thanks. |
I believe I'm having this issue after installing Visual Studio v15.3.1 and I am not sure what I need to do to resolve it. I have a WebSite project that references several NuGet packages which target Netstandard 1.6. After installing the new Visual Studio I first encountered Issue and fixed that by applying the workaround:
Then I started getting the YSOD at runtime: If I set my build output to detailed I can see the following:
I've cleaned and rebuilt the solution, deleted my bin and obj directories and tried again, and installed the NETStandard.Library v2.0.0 package, and I always get the same YSOD and the same errors in the build log. Do I need to ensure that all of the NuGet packages referenced by the project target NetStandard 2.0? I figured that installing the NETStandard.Library into the web project would fix it if that was the issue but it didn't. I've also tried both with and without |
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. |
See dotnet/core#730 (comment).
Related: https://github.com/dotnet/corefx/issues/19058
The netstandard mapping for
net461
changed fromnetstandard1.4
tonetstandard2.0
and NET462 changed fromnetstandard1.5
tonetstandard2.0
.This causes a ref-def mismatch for our old packages, consider System.Runtime:
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 fornet462
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.
The text was updated successfully, but these errors were encountered: