Commit de245f1
chore: enable IL trim analyzer on Web.Client project (#447)
* chore: enable IL trim analyzer on Web.Client to catch trim issues at build time
Enables EnableTrimAnalyzer and SuppressTrimAnalysisWarnings on the Blazor
WASM project so trim-unsafe patterns surface as build errors (via
TreatWarningsAsErrors) rather than runtime failures after publish.
Suppresses IL2110/IL2111 (framework Razor codegen false positives) and
IL2026 at PersistentComponentState call sites (string serialization is
trim-safe but the API lacks source-generator overloads).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: remove SuppressTrimAnalysisWarnings which also affects ILLink at publish
SuppressTrimAnalysisWarnings=false surfaces warnings from the ILLink
trimmer during publish (IL2026/IL2104 from third-party assemblies),
not just from the Roslyn analyzer. EnableTrimAnalyzer alone is sufficient
for build-time detection.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* address review: replace #pragma with [UnconditionalSuppressMessage]
#pragma warning disable only works for the Roslyn analyzer and is
ignored by ILLink during publish. UnconditionalSuppressMessage is
persisted in IL and respected by both.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 05d9488 commit de245f1
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
0 commit comments