aspnetcore: Blazor wasm client fails to start when PublishTrimmed=true and built using 7.0.201 and above
Describe the bug
I have a Blazor WASM hosted 7.0 project with the following settings:
<PublishTrimmed>true</PublishTrimmed>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<TrimMode>partial</TrimMode>
There is code that likely cannot be trimmed I’m sure, reflection, dynamic components, etc, however, when the client (and host) app is built using 7.0.103 sdk the app exhibits no runtime issue with these trim settings.
I build and deploy using a dockerfile with a base sdk image. SDKs 7.0.104 and 7.0.200 did not get docker image releases so cannot try those versions. Using SDK 7.0.201 and the recent 7.0.202 causes the exception below in the browser when the app starts up.
If I set PublishTrimmed=false then no trimming occurs of course but the app also works normally, so this appears to be some trim behaviour introduced in 7.0.201 (and perhaps 7.0.200 but I cannot test for that). Are there any things trim-wise that could be affecting the app at startup in these new versions, or is their even some diagnostics I can setup to try and get to the bottom of what might be the issue?
To Reproduce
Unfortunately I cannot create a repro.
Exceptions (if any)

Further technical details
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (8 by maintainers)
Sorry I should have commented earlier. It’s been working great with 8.0.100.
Thanks for everyone’s efforts.