Description
From @LXGaming in dotnet/linker#3168 (comment):
Documenting an issue I encountered with GitHub Actions Runner ubuntu22/20231115.7 (includes .NET 8) when building a .NET 7 project.
I use GitHub Actions for publishing trimmed .NET binaries, my workflow consists of a
restore
step and all subsequent steps use--no-restore
, I found that builds were no longer being trimmed due to ILLink having disappeared. I eventually stumbled upon this issue and its linked PRs which noted that a restore would be required for ILLink to be downloaded, because I use/p:PublishTrimmed=true
and--no-restore
on thepublish
command ILLink is never downloaded.The solution is to add
/p:PublishTrimmed=true
to the restore command or alternatively avoid using--no-restore
to ensure that ILLink is present.I believe there should be a warning or error when PublishTrimmed is specified but ILLink isn't present.