Skip to content

Commit

Permalink
Fix PublishAot single warning issue for ProjectReferences (#101799)
Browse files Browse the repository at this point in the history
When publishing for native AOT and a ProjectReference has trim/AOT warnings, all the warnings are being collapsed into a single "warning IL2104: Assembly 'X' produced trim warnings."

The issue is that we are using FileName, which cuts off the file extension of the item. But the items we are working with already cut off the `.dll` extension, so it this is cutting off important parts of the assembly name. The fix is to just use Identity, which is the whole item id.
  • Loading branch information
eerhardt authored May 2, 2024
1 parent 24ded28 commit 40c024f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<IlcArg Include="@(_IlcRootedAssemblies->'--root:%(Identity)')" />
<IlcArg Include="@(_IlcConditionallyRootedAssemblies->'--conditionalroot:%(Identity)')" />
<IlcArg Include="@(_IlcTrimmedAssemblies->'--trim:%(Identity)')" />
<IlcArg Include="@(_IlcNoSingleWarnAssemblies->'--nosinglewarnassembly:%(Filename)')" />
<IlcArg Include="@(_IlcNoSingleWarnAssemblies->'--nosinglewarnassembly:%(Identity)')" />
<IlcArg Condition="'$(TrimmerDefaultAction)' == 'copyused' or '$(TrimmerDefaultAction)' == 'copy' or '$(TrimMode)' == 'partial'" Include="--defaultrooting" />
<IlcArg Include="--resilient" />
<IlcArg Include="@(UnmanagedEntryPointsAssembly->'--generateunmanagedentrypoints:%(Identity)')" />
Expand Down

0 comments on commit 40c024f

Please sign in to comment.