.NET 11 regression: malformed linker XML in Components.Endpoints causes IL2101 during trimmed publishing
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- build-system
Research direction
Start with the embedded ILLink.Substitutions.xml resource in the Microsoft.AspNetCore.Components.Endpoints project, and check its assembly fullname against the one the Forms assembly actually uses. The issue points to commit 309d909185 (PR #65903) as the source of the bad entry. Run the console repro from the issue with -p:PublishTrimmed=true -p:ILLinkTreatWarningsAsErrors=true; done means IL2101 no longer appears and publishing succeeds.
Written by the indexing model from the issue text.
Description
Describe the bug
Microsoft.AspNetCore.Components.Endpoints embeds an ILLink.Substitutions.xml resource whose assembly fullname incorrectly targets Microsoft.AspNetCore.Components.Forms. This causes IL2101 during trimmed publishing.
This affects trimmed publishing of Blazor applications and can also occur in non-Blazor applications. A console application referencing Microsoft.AspNetCore.App and using IHtmlHelper reproduces the problem without RazorSlices, Razor files, MVC services, or Blazor registration.
When IL2101 is treated as an error, publishing fails with NETSDK1144.
Expected Behavior
The embedded linker XML targets the correct assembly, and the application publishes without IL2101, as it does with .NET 10.
Steps To Reproduce
Using .NET SDK 11.0.100-rc.3.26522.148, create a console application with these files.
Repro.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net11.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
Program.cs
System.Console.WriteLine(
typeof(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper).FullName);
Publish with trimming enabled:
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishAot=false -p:PublishTrimmed=true -p:ILLinkTreatWarningsAsErrors=false
Observe IL2101 for the embedded ILLink.Substitutions.xml resource in Microsoft.AspNetCore.Components.Endpoints.
Repeat with -p:ILLinkTreatWarningsAsErrors=true to observe publishing fail with NETSDK1144.
Exceptions (if any)
IL2101 reports malformed linker XML. Treating the warning as an error causes NETSDK1144.
.NET Version
Reported with SDK 11.0.100-rc.3.26522.148.
The equivalent net10.0 reproduction using SDK 10.0.403 and runtime/linker packs 10.0.14 does not emit IL2101.
Anything else?
According to Damian's investigation:
- ViewFeatures leads the linker to Components.Endpoints. Its XML is parsed even though Endpoints is unmarked and removed from the final output.
- The malformed resource was introduced by commit
309d909185in #65903 and remained incorrect on the inspectedmainsnapshot. - The .NET 10 linker already performs the cross-assembly XML check, so this is a framework resource regression rather than a new linker diagnostic.
This issue isolates the IL2101 problem described in #69270 and tracks its impact on both Blazor and non-Blazor applications.
Proposed servicing target: the first .NET 11 servicing window in December, subject to servicing approval.
- Dominant language
- C#
- Stars
- 38.5k
- Forks
- 13k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 164
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/aspnetcore
-
Include host.wslc.internal in the HTTPS development certificatePossibly taken @afscrome claimed this 2 days ago. Openarea-commandlinetools
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dotnet/aspnetcore#70122 · 1 comment ·
Maintainers usually reply within 1 day
-
QuickGrid does not call stop when disposed while init is pendingPossibly taken @surya3655 claimed this 2 days ago. Openarea-blazor feature-blazor-quickgrid
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dotnet/aspnetcore#70072 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
RedisOutputCacheStore force reconnect can release the current connection instead of the failed oneOpenarea-middleware
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#70029 · 3 comments ·
Maintainers usually reply within 1 day
-
area-middleware
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dotnet/aspnetcore#69849 · 1 comment ·
Maintainers usually reply within 1 day
-
area-signalr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dotnet/aspnetcore#69842 · 1 comment ·
Maintainers usually reply within 1 day
All issues in dotnet/aspnetcore
Similar issues
-
enhancement P3 performance
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
thomhurst/TUnit#7380 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation trivial
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PCL-Community/PCL-CE#3767 ·
Maintainers usually reply within 1 day
-
bug priority: P2
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
area-System.IO untriaged
Difficulty 2/5 Half a day Newbie friendliness 72/100
dotnet/runtime#136802 · 1 comment ·
Maintainers usually reply within 1 day