Commit a1321f4
authored
Fix trimming issue (#51665)
# [release/8.0] Fix trimming issue affecting Blazor apps with WebAssembly interactivity
Fixes an issue where the Blazor WebAssembly runtime would fail on startup for published Blazor apps utilizing WebAssembly interactivity.
## Description
The problem was caused by the members of `RootComponentOperationBatch` getting trimmed away. This fix explicitly preserves its members to prevent this from happening.
Fixes dotnet/AspNetCore-ManualTests#2420
## Customer Impact
Without this fix, WebAssembly interactivity won't work in any published Blazor Web app.
Today, customers could work around the issue by defining a `<TrimmerRootDescriptor>` in their client project's `.csproj` file. For example:
```csproj
<!-- Client.csproj -->
<ItemGroup>
<TrimmerRootDescriptor Include="Roots.xml" />
</ItemGroup>
```
```xml
<!-- Roots.xml -->
<linker>
<assembly fullname="Microsoft.AspNetCore.Components.WebAssembly">
<type fullname="Microsoft.AspNetCore.Components.RootComponentOperationBatch" preserve="all">
</type>
</assembly>
</linker>
```
## Regression?
- [X] Yes
- [ ] No
Regressed from .NET 8 RC2.
## Risk
- [ ] High
- [ ] Medium
- [X] Low
The fix does nothing more than mark the members of `RootComponentOperationBatch` to be preserved for JSON serialization.
## Verification
- [X] Manual (required)
- [ ] Automated
## Packaging changes reviewed?
- [ ] Yes
- [ ] No
- [X] N/A1 parent 34a9589 commit a1321f4
File tree
1 file changed
+1
-0
lines changed- src/Components/WebAssembly/WebAssembly/src/Services
1 file changed
+1
-0
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
0 commit comments