Skip to content

Commit e9167fe

Browse files
committed
fix(cli): remove PublishTrimmed from CLI csproj
RegiLattice.Core uses reflection-based JsonSerializer in Analytics, AppConfig, Favorites, TweakHistory, PackManager, PipManager, PluginSandbox, ComplianceHistory and StartupManager. With PublishTrimmed=true these produce 48 IL2026 trim-analysis errors during self-contained publish. Removing PublishTrimmed/TrimMode/JsonSerializerIsReflectionEnabledByDefault eliminates all IL2026 errors without any code suppression. The EXE is slightly larger but all functionality is preserved intact. Invariant globalization is kept for the ICU bundle size saving.
1 parent 8bc4f14 commit e9167fe

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

src/RegiLattice.CLI/RegiLattice.CLI.csproj

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,13 @@
1010
on batch operations (apply-all, status-map, profile apply).
1111
CLI is short-lived so the extra per-heap memory is reclaimed quickly. -->
1212
<ServerGarbageCollection>true</ServerGarbageCollection>
13-
<!-- IL trimming (partial mode): only trims framework assemblies that
14-
opted in via [assembly: IsTrimmable]. Reduces single-file EXE size
15-
by 30-50%. WinForms blocks trimming, so this is CLI-only. -->
16-
<PublishTrimmed>true</PublishTrimmed>
17-
<TrimMode>partial</TrimMode>
18-
<!-- Invariant globalization: the CLI uses ordinal string comparisons
19-
throughout and has no locale-dependent formatting of user-facing
20-
text beyond fixed English output. Stripping ICU saves ~3 MB and
21-
removes the ICU data file dependency from the single-file bundle. -->
13+
<!-- Trimming disabled: RegiLattice.Core uses reflection-based JSON in many
14+
services (Analytics, AppConfig, Favorites, TweakHistory, PackManager,
15+
etc.) which would produce 48+ IL2026 trim-analysis errors. Since Core
16+
is not trim-safe its assembly cannot participate in partial trimming.
17+
The self-contained EXE is ~10 MB larger without trimming, but all
18+
reflection-based code paths remain intact. -->
2219
<InvariantGlobalization>true</InvariantGlobalization>
23-
<!-- Keep reflection-based JSON enabled at runtime: PublishTrimmed=true
24-
causes the SDK to inject IsReflectionEnabledByDefault=false into
25-
runtimeconfig.json, but RegiLattice.Core services (Analytics, etc.)
26-
still use reflection-based JsonSerializer. CLI's own calls are all
27-
source-gen via CliJsonContext — this switch only affects Core. -->
28-
<JsonSerializerIsReflectionEnabledByDefault>true</JsonSerializerIsReflectionEnabledByDefault>
2920
</PropertyGroup>
3021

3122
<ItemGroup>

0 commit comments

Comments
 (0)