-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Apply XML Configuration for Removing Specific Attribute Instances in .NET Linker ( NativeAOT ) #101680
Comments
Tagging subscribers to this area: @dotnet/area-meta |
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas |
/FYI @LakshanF |
I've used something like this before: <ItemGroup Condition="'$(PublishTrimmed)' == 'True'">
<RdXmlFile Include="rd.xml" />
</ItemGroup> |
However, its also worth highlighting - NativeAOT uses a different format to the linker: https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/docs/rd-xml-format.md, So I'm not sure if the XML file you have currently will actually work with NativeAOT. |
I inserted before the start of the file and compilation completed successfully. But this did not reduce the weight of the program.😁 |
I'll admit, I've not really messed with trimming recently - that snippet was just copied from an old piece of code I had lying around. WinForms does not officially support Native AOT anyway: dotnet/winforms#4649 |
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
The native AOT compiler doesn't have any switches (documented or not) to inject this file into compilation and there are no plans to add one. This file format is only for use within the dotnet/runtime repo. FWIW there is work in progress to make WinForms trimmable. |
Hello,
I am working on a .NET project and would like to optimize my assembly by removing specific attribute instances using the .NET linker. I have defined the following XML configuration but need guidance on properly integrating it with the linker in a .NET project:

How should this XML be integrated into the .NET project configuration to instruct the linker to remove these attribute instances?
The text was updated successfully, but these errors were encountered: