Skip to content

Error: AOT Support throws the error "PublishTrimmed is implied by native compilation and cannot be disabled". #109452

@sudharsan-narayanan

Description

@sudharsan-narayanan

Description

Once created the WinUI project in Visual Studio, Just upgrade the SDK version. Added the PublishAOT tag as true. Tried to publish the exe through the below command,

dotnet publish -c release -r win-x64

but it throws the error in output window

C:\Users\.nuget\packages\microsoft.dotnet.ilcompiler\8.0.8\build\Microsoft.NETCore.Native.Publish.targets(55,5): Error : PublishTrimmed is implied by native compilation and cannot be disabled.

Reproduction Steps

NA

Expected behavior

Once added the PublishAOT tag in project, the project should works as expected in AOT.

Actual behavior

Throws error while running the project

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-coreclrneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions