You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Unable to generate linker-dependencies.xml for Windows SDK projects #3212
Your project uses PublishAot=true which will end up using the AOT compiler (ilc), not the illink tool. The _TrimmerDumpDependencies property only acts when the illink tool is used.
Alternatively you can publish your project without AOT so /p:PublishAot=false /p:PublishTrimmed=true in which case the illink will be used and you will be able to use the analyzer tool from this repo.
Note that the trimming behavior between illink and ilc can be different, the tools have somewhat different capabilities in some areas.
Also note that the development of illink and all of the related tools has moved to the dotnet/runtime repo.
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.
I opened a PR to fix the doc in the runtime repo (for the analyzer tool): dotnet/runtime#84833
To get the linker dependencies XML usable by the analyzer tool: dotnet publish /p:PublishTrimmed=true /p:_TrimmerDumpDependencies=true
The output is in obj/Release/net7.0-windows10.0.22621.0/win-x64/linked/linker-dependencies.xml. This file can be consumed by the illinkanalyzer tool.
You can also get dgml file from the illink: dotnet publish /p:PublishTrimmed=true /p:_TrimmerDumpDependencies=true /p:_TrimmerDependenciesFileFormat=dgml
The output is now in obj\Release\net7.0-windows10.0.22621.0\win-x64\linked\linker-dependencies.dgml.
This can be consumed by the DependencyGraphViewer tool in https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/aot/DependencyGraphViewer.
NativeAOT can only produce the dgml file: dotnet publish /p:PublishAot=true /p:IlcGenerateDgmlFile=true
The output is going to be in obj\Release\net7.0-windows10.0.22621.0\win-x64\native\<app>.codegen.dgml.xml (and another file called <app>.scan.dgml.xml since the compiler does too passes on the input, so two dependency graphs).
This can be consumed by the DependencyGraphViewer tool as well.
Activity
vitek-karas commentedon Apr 11, 2023
Your project uses
PublishAot=truewhich will end up using the AOT compiler (ilc), not theillinktool. The_TrimmerDumpDependenciesproperty only acts when theillinktool is used.You do have
IlcGenerateDgmlFilewhich is the equivalent functionality for the AOT compiler. This should produce a.dgmlfile inobj\<Configuration>\<TFM>\<RID>\native\. You can used theDependencyGraphViewertool to inspect it: https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/aot/DependencyGraphViewerAlternatively you can publish your project without AOT so
/p:PublishAot=false /p:PublishTrimmed=truein which case theillinkwill be used and you will be able to use the analyzer tool from this repo.Note that the trimming behavior between
illinkandilccan be different, the tools have somewhat different capabilities in some areas.Also note that the development of
illinkand all of the related tools has moved to the dotnet/runtime repo.mitchcapper commentedon Apr 11, 2023
Hrm. Still no luck. Removed the Properties folder from that sample and updated the 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.
vitek-karas commentedon Apr 14, 2023
The instructions are only valid for Xamarin projects. For console projects the trimmer/aot only runs during publish.
I opened a PR to fix the doc in the runtime repo (for the analyzer tool): dotnet/runtime#84833
To get the linker dependencies XML usable by the analyzer tool:
dotnet publish /p:PublishTrimmed=true /p:_TrimmerDumpDependencies=trueThe output is in
obj/Release/net7.0-windows10.0.22621.0/win-x64/linked/linker-dependencies.xml. This file can be consumed by theillinkanalyzertool.You can also get dgml file from the illink:
dotnet publish /p:PublishTrimmed=true /p:_TrimmerDumpDependencies=true /p:_TrimmerDependenciesFileFormat=dgmlThe output is now in
obj\Release\net7.0-windows10.0.22621.0\win-x64\linked\linker-dependencies.dgml.This can be consumed by the
DependencyGraphViewertool in https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/aot/DependencyGraphViewer.NativeAOT can only produce the dgml file:
dotnet publish /p:PublishAot=true /p:IlcGenerateDgmlFile=trueThe output is going to be in
obj\Release\net7.0-windows10.0.22621.0\win-x64\native\<app>.codegen.dgml.xml(and another file called<app>.scan.dgml.xmlsince the compiler does too passes on the input, so two dependency graphs).This can be consumed by the
DependencyGraphViewertool as well.There's some additional details about some of this here: https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/aot/DependencyGraphViewer#readme