Skip to content

Commit 0f5ceb1

Browse files
punkouter26claude
andcommitted
Fix published WASM crash: stop member-trimming the Client assembly
IsTrimmable=true let the IL trimmer strip constructors from components that are only instantiated via reflection (typeof(MainLayout) through Router/LayoutView), crashing the published app with CtorNotLocated. The suppressed IL2110/IL2111 warnings were flagging exactly this path. Blazor's default partial trim mode still trims framework assemblies. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b46045f commit 0f5ceb1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/PoSeeReview.Client/PoSeeReview.Client.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<PropertyGroup>
44
<TargetFramework>net10.0</TargetFramework>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6-
<IsTrimmable>true</IsTrimmable>
6+
<!-- Do NOT set IsTrimmable on this assembly: the Router/LayoutView instantiate
7+
components via reflection (typeof(MainLayout) in App.razor), so member-level
8+
trimming strips their constructors and the published app dies at runtime with
9+
CtorNotLocated. Blazor's default partial trim mode still trims the framework. -->
710
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
811
<!-- English-only UI: run invariant so the ~1.5MB ICU payload (icudt_*.dat) is not shipped,
912
cutting first-load size and one extra network round-trip. -->

0 commit comments

Comments
 (0)