-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Adding type-forwards for ValueTuple to desktop 4.7 #18519
Conversation
@dotnet-bot test Innerloop PortableLinux Debug x64 Build and Test please |
@dotnet-bot test Innerloop PortableLinux Debug x64 Build and Test please |
I would suggest trying to add a reference to this local package from a .NET 4.7 console application or if we don't have the tooling for that yet, try at least taking the binary and consuming it on .NET 4.7. |
@ericstj how do you want to handle this in the desktop support package? |
@weshaggard we need a separate build of both ref (shims.proj so that it unifies with ValueTuple in mscorlib) and lib to support net47. Without that we'd have type-conflicts at compile-time. Can you open an issue to track this? I can imagine we'll have cases where folks build against 4.6.1 and run on 4.7: @jcouv can you confirm that'd work as expected? |
So I couldn't create a project for a .NET 4.7 console app, because that framework isn't available in VS yet (although strangely it is already listed on this web page, which opens when you click "Install other frameworks…"). So instead, I extracted the ValueTuple ref dll from the package and built a simple console app referencing it (and also the .NET 4.7 mscorlib from GAC, which I got from down-level install). This worked fine and the resulting exe doesn't even reference the ValueTuple assembly (since it only had type-forwards).
|
One additional test you should do is to consume a library in your 4.7 console application that was built against System.ValueTuple and make sure it works as expected. I believe it will but just one extra layer of verification. |
We need to add this to src project:
|
@weshaggard The second scenario worked too, but I had to use assembly binding redirect so that the library (compiled against 4.0.1.0 VT.dll) would load the new 4.0.2.0 VT.dll. Let me know if there is anything else. Otherwise, I'll go ahead and merge later today. |
Nothing else from my side. Thanks for testing. |
I'll go ahead and merge. Thanks! |
@weshaggard @ericstj @AlexGhiondea for review.
Fixes https://github.com/dotnet/corefx/issues/15175
I filed a follow-up issue (https://github.com/dotnet/corefx/issues/18518) to reference the shipped targeting pack instead of the pre-release one from myget.
Do you have any tips on validation?
So far, I inspected the produced package, and verified that it adds a "net47" folder under "lib" and "ref", and that it contains assemblies with type-forwards, and only referencing
mscorlib
.Ref folder before:
And after change:
Lib folder before:
And after change;