-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Description
PR #125365 ("Simplify ILLink/ILC root assembly handling: TrimmerRootAssembly assembly names only") removed the File.Exists() fallback from RootAssemblyInputStep.LoadAssemblyByName(), making ILLink resolve root assemblies exclusively via Context.TryResolve() (name-based resolution using -d search directories).
This breaks the aspnetcore shared framework build, which passes assembly names (not paths) to TrimmerRootAssembly, but the assemblies can't be resolved because the search directories don't cover all output paths:
ILLink : error IL1032: Root assembly with name 'Microsoft.AspNetCore.Authorization' could not be found.
ILLink : error IL1032: Root assembly with name 'Microsoft.AspNetCore.Components' could not be found.
This is blocking:
- dotnet/aspnetcore#65987 (codeflow PR)
- dotnet/sdk#53613 (codeflow PR — SDK test used
%(FullPath)but that's fixed, the aspnetcore issue remains)
Root Cause
The old code in RootAssemblyInputStep had a File.Exists() check that would load assemblies directly from a file path. The new code only does:
var assembly = Context.TryResolve(assemblyName);TryResolve depends on -d search directory arguments. The aspnetcore shared fx build doesn't have all assembly output directories in the search path, so ILLink can't find them by name alone.
Options
- Fix search directories — Update
Microsoft.NET.ILLink.targetsto include allResolvedFileToPublishdirectories as-darguments - Restore fallback — Add
File.Exists()fallback inLoadAssemblyByName()for backward compatibility (but this partially reverts the incremental build fix) - Fix aspnetcore build — Add explicit
-darguments in the shared fx build targets
Metadata
Metadata
Assignees
Labels
Type
Projects
Status