.NET

Stripping extra dependencies in .NET NativeAOT apps using linker substitutions

A Datadog engineer describes using linker method substitutions to strip unneeded dependencies from dd-dotnet, a NativeAOT-compiled command line tool shipped with the Datadog .NET SDK. Updating the ClrMD (Microsoft.Diagnostics.Runtime) package for upcoming .NET 11 support pulled in a web of dependencies the linker could not remove on its own. Substitutions enabled additional dead-code elimination and significantly reduced the final binary size.

AI-written summary, checked against the cited sources. How summaries work

Image: Andrew Lock

Read at Andrew Lock