Skip to content

Multiple IL2049 warnings when publishing with NativeAOT and _AggressiveAttributeTrimming #88994

Closed
@Sergio0694

Description

@Sergio0694

Description

I tried using _AggressiveAttributeTrimming to check the size diffs, and noticed a whole bunch of warnings:

resource ILLink.LinkAttributes.xml in System.Private.CoreLib(377,8): warning IL2049: System.Private.CoreLib: The internal attribute name 'RemoveAttributeInstances' being used in the xml is not supported by ILLink, check the spelling and the supported internal attributes. [C:\Users\sergiopedri\git\ComputeSharp\samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj]

Reproduction Steps

$env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true';
dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -c Release -f net8.0 -r win-x64

Expected behavior

Should build with no warnings.

Actual behavior

When _AggressiveAttributeTrimming is set, you get a whole bunch of warnings.

Configuration

  • 8.0.100-preview.7.23364.32

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions