Conversation
mkArtakMSFT
left a comment
There was a problem hiding this comment.
Thanks for figuring this out, John!
dougbu
left a comment
There was a problem hiding this comment.
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.