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 }}
Repository navigation
ILLink IL1032 regression: root assembly name resolution fails for shared framework build after #125365 #126268
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.
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:
varassembly=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.targets to include all ResolvedFileToPublish directories as -d arguments
Restore fallback — Add File.Exists() fallback in LoadAssemblyByName() for backward compatibility (but this partially reverts the incremental build fix)
Fix aspnetcore build — Add explicit -d arguments in the shared fx build targets
Add explicit -d arguments in the shared fx build targets
I tried this in dotnet/aspnetcore@ca50ef4 without any luck. I tried a bunch of different approaches to get the assemblies passed to ILLink but nothing seemed to work.
The RootAssemblyNames was designed from the start and documented as taking assembly names, not paths. This change was necessary to fix an incremental build issue - any consumers should ensure they are passing assembly names, not paths, to this input.
making ILLink resolve root assemblies exclusively via Context.TryResolve() (name-based resolution using -d search directories).
The full paths need to be passed as AssemblyPaths which will allow them to be resolved. -d is not documented or supported and should not be used. Looks like @wtgodbe fixed this in aspnetcore already and I think it's no longer blocked on this. I pushed a fix to the sdk codeflow as well.
I'm going to close this but feel free to re-open if you think there's more that needs to be done here. Also happy to help if there are more code flow issues.
Activity
dotnet-policy-service commentedon Mar 28, 2026
Tagging subscribers to this area: @agocke, @elinor-fung
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Mar 28, 2026
Tagging subscribers to this area: @agocke, @dotnet/illink
See info in area-owners.md if you want to be subscribed.
wtgodbe commentedon Mar 29, 2026
I tried this in dotnet/aspnetcore@ca50ef4 without any luck. I tried a bunch of different approaches to get the assemblies passed to ILLink but nothing seemed to work.
sbomer commentedon Mar 30, 2026
The
RootAssemblyNameswas designed from the start and documented as taking assembly names, not paths. This change was necessary to fix an incremental build issue - any consumers should ensure they are passing assembly names, not paths, to this input.The full paths need to be passed as
AssemblyPathswhich will allow them to be resolved.-dis not documented or supported and should not be used. Looks like @wtgodbe fixed this in aspnetcore already and I think it's no longer blocked on this. I pushed a fix to the sdk codeflow as well.I'm going to close this but feel free to re-open if you think there's more that needs to be done here. Also happy to help if there are more code flow issues.