-
Notifications
You must be signed in to change notification settings - Fork 127
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
Unable to generate linker-dependencies.xml for Windows SDK projects #3212
Comments
Your project uses You do have Alternatively you can publish your project without AOT so Note that the trimming behavior between Also note that the development of |
Hrm. Still no luck. Removed the Properties folder from that sample and updated the project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<TrimMode>full</TrimMode>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
<PublishAot>false</PublishAot>
<StripSymbols>true</StripSymbols>
<SelfContained>true</SelfContained>
<PublishTrimmed>true</PublishTrimmed>
<PublishSingleFile>true</PublishSingleFile>
<DebuggerSupport>false</DebuggerSupport>
<PublishReadyToRun>false</PublishReadyToRun>
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<EventSourceSupport>false</EventSourceSupport>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<InvariantGlobalization>true</InvariantGlobalization>
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
<UseNativeHttpHandler>true</UseNativeHttpHandler>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<IlcGenerateDgmlFile>true</IlcGenerateDgmlFile>
</PropertyGroup>
</Project>
I am not sure where I found the link to this or the docs talking about native AOT size optimization so its possible I read it wrong or it wasn't clear one vs the other. In terms of the wrong repo I do see it at https://github.com/dotnet/runtime/tree/main/src/tools/illink/src/analyzer for this (potential) bug not sure if I should re-file it under dotnet runtime. |
The instructions are only valid for Xamarin projects. For console projects the trimmer/aot only runs during publish. To get the linker dependencies XML usable by the analyzer tool: You can also get dgml file from the illink: NativeAOT can only produce the dgml file: There's some additional details about some of this here: https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/aot/DependencyGraphViewer#readme |
per: https://github.com/dotnet/linker/blob/main/src/analyzer/README.md
it seems like this should work for .net SDK style projects but I am having no luck.
I created a simple repro test case and built it using
msbuild /p:_TrimmerDumpDependencies=true /p:Configuration=Release /t:Rebuild
but no linker xml file is generated. Attached is the project and the build output.
LinkerAnalyzerFail.zip
msbuild_output.txt
The text was updated successfully, but these errors were encountered: