-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Ref pack fix [3.1] #18380
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
Ref pack fix [3.1] #18380
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for figuring this out, John!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome if this works 😺
Can you explain why the condition and exclusions operate differently? Do the exclusions work correctly for the %(...NuGetPackageId)
cases?
Test failure is something known to @BrennanConroy and he's promised to fix it soon. Getting this in. |
I'm working on it right now :) |
@Pilchie FYI I put this into the 3.1.2 milestone and marked it as |
I'm (so far), only seeing 4 small things that I think are non-controversial in that label. Feel free to send the heads up to tactics. |
Awesome, thanks @JunTaoLuo! |
My understanding is that Exclusion filters on the Identity but Condition isn't. For example, if you have two items in the ItemGroup A [Metadata = x] and A [Metadata = y] , the items
will resolve to:
Which means that Filtered will resolve to empty. Condition doesn't work this way and is applied to all items regardless of Identity. My suspicion is that in the past the ReferencePathWithRefAssemblies items had different identities (for ref and impl assemblies) but now resolves to the same file as its identity. Luckily all the metadata remained so we can still filter correctly. |
It seems like the issue in the 3.1 template tests are caused by malformed targeting pack. In fact no ref assemblies were included in the targeting pack:

Indeed it seems like we weren't capturing aspnetcore ref assemblies in the ref pack contents at https://github.com/dotnet/aspnetcore/blob/release/3.1/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj#L131-L140

It turns out that the items ReferencePathWithRefAssemblies had the same identity (but different metadata) between implementation assemblies and ref assemblies and were therefore being excluded by the line https://github.com/dotnet/aspnetcore/blob/release/3.1/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj#L139

I haven't tracked down how or when this broke but it would have been something that was between the branding changes and when #17970 was first opened.