Skip to content

Commit 28b9880

Browse files
eerhardtmichaelgsharp
authored andcommitted
Fix PublishAot single warning issue for ProjectReferences (dotnet#101799)
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.
1 parent f83e5a5 commit 28b9880

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ The .NET Foundation licenses this file to you under the MIT license.
281281
<IlcArg Include="@(_IlcRootedAssemblies->'--root:%(Identity)')" />
282282
<IlcArg Include="@(_IlcConditionallyRootedAssemblies->'--conditionalroot:%(Identity)')" />
283283
<IlcArg Include="@(_IlcTrimmedAssemblies->'--trim:%(Identity)')" />
284-
<IlcArg Include="@(_IlcNoSingleWarnAssemblies->'--nosinglewarnassembly:%(Filename)')" />
284+
<IlcArg Include="@(_IlcNoSingleWarnAssemblies->'--nosinglewarnassembly:%(Identity)')" />
285285
<IlcArg Condition="'$(TrimmerDefaultAction)' == 'copyused' or '$(TrimmerDefaultAction)' == 'copy' or '$(TrimMode)' == 'partial'" Include="--defaultrooting" />
286286
<IlcArg Include="--resilient" />
287287
<IlcArg Include="@(UnmanagedEntryPointsAssembly->'--generateunmanagedentrypoints:%(Identity)')" />

0 commit comments

Comments
 (0)