TL;DR: from AI investigation, the large size of the binaries is from the included .NET runtime for the --self-contained build option. An easy win would be to produce a second set of build artefacts without this flag applied and the user can decide which version they want.
Why the compiled GUI binaries are ~100 MB
The size is dominated by a few things, in order of impact:
-
Bundled .NET runtime (largest cost, ~55–70 MB). build.sh publishes with --self-contained --PublishSingleFile, so every binary packs the entire .NET 10 runtime. The GUI is even forced to be self-contained: it references GuiUpdater as a self-contained executable (confirmed — a framework-dependent publish fails with NETSDK1151). That's why the tiny ObjectEditorUpdater is still 82 MB.
-
EF Core / ASP.NET / SQLite dead weight pulled in via Definitions (~10–20 MB). The GUI talks to the ObjectService purely over HTTP (ObjectServiceClient uses HttpClient — see Gui/ObjectServiceClient.cs). But because the GUI references the Definitions project, it transitively inherits Microsoft.EntityFrameworkCore + .Relational + .Sqlite, System.Linq.Expressions (3.6 MB), System.Data.Common, e_sqlite3.dll, ASP.NET Authorization/Identity, migrations, etc. The JIT can't strip them from the bundle. None of it is used at runtime by the GUI.
-
Avalonia + SkiaSharp backend (~15 MB .NET parts + native libSkiaSharp.dll 11 MB, av_libglesv2.dll 5.4 MB, HarfBuzz, etc.), plus Material.Icons.dll (5.7 MB embedded font), SixLabors.ImageSharp, NAudio.
-
~100 MB of debug symbols (.pdb) in the published/archived output — libSkiaSharp.pdb (84 MB) and libHarfBuzzSharp.pdb (21 MB) ship as package content and were being zipped into the release.
Measured sizes (win-x64): ObjectEditor.exe 108.7 MiB, ObjectEditorUpdater.exe 78 MiB, publish folder 307.8 MB, of which 100.7 MB is .pdb.
What I changed (verified with real builds)
Gui/Gui.csproj — gated the Avalonia DiagnosticsSupport dev-tool package to Debug only (the existing comment already said this was intended). Verified: Release ObjectEditor.exe dropped 108.7 → 107.3 MiB, and AvaloniaUI.DiagnosticsSupport.Avalonia.dll no longer ships.
build.sh — added a step that deletes *.pdb from all three publish folders before archiving. Verified the Windows publish folder has 100.7 MB of .pdb; removing them cuts the distributed folder from ~307.8 MB → ~207 MB, and the release zip/TAR shrinks correspondingly.
What I tested and rejected (so I didn't add noise)
-p:StripSymbols=true for Linux/macOS: measured zero effect (identical 108.5 MB binary), so I left it out.
- Dropping self-contained / framework-dependent build: not possible without product changes (NETSDK1151) and would require users to install .NET 10.
Recommendations (higher-risk; not applied)
- Split the database/server-only deps out of
Definitions (e.g., a Definitions.Database module for the EF Core models/migrations). The GUI only needs the DTOs/ObjectModels, so removing EFC/SQLite/ASP.NET from its dependency closure could save ~10–20 MB per binary. This is the biggest remaining reducible win, but it's a moderate-to-large refactor shared with the server side, so it needs the module's test coverage to validate.
- If end-user UX allows it, shipping framework-dependent would save ~55–70 MB per binary (at the cost of requiring a .NET 10 install).
- Avoid Avalonia
--enable-trimming; Avalonia doesn't recommend it for correctness.
TL;DR: from AI investigation, the large size of the binaries is from the included .NET runtime for the
--self-containedbuild option. An easy win would be to produce a second set of build artefacts without this flag applied and the user can decide which version they want.Why the compiled GUI binaries are ~100 MB
The size is dominated by a few things, in order of impact:
Bundled .NET runtime (largest cost, ~55–70 MB).
build.shpublishes with--self-contained --PublishSingleFile, so every binary packs the entire .NET 10 runtime. The GUI is even forced to be self-contained: it referencesGuiUpdateras a self-contained executable (confirmed — a framework-dependent publish fails withNETSDK1151). That's why the tinyObjectEditorUpdateris still 82 MB.EF Core / ASP.NET / SQLite dead weight pulled in via
Definitions(~10–20 MB). The GUI talks to the ObjectService purely over HTTP (ObjectServiceClientusesHttpClient— seeGui/ObjectServiceClient.cs). But because the GUI references theDefinitionsproject, it transitively inheritsMicrosoft.EntityFrameworkCore+.Relational+.Sqlite,System.Linq.Expressions(3.6 MB),System.Data.Common,e_sqlite3.dll, ASP.NET Authorization/Identity, migrations, etc. The JIT can't strip them from the bundle. None of it is used at runtime by the GUI.Avalonia + SkiaSharp backend (~15 MB .NET parts + native
libSkiaSharp.dll11 MB,av_libglesv2.dll5.4 MB, HarfBuzz, etc.), plusMaterial.Icons.dll(5.7 MB embedded font), SixLabors.ImageSharp, NAudio.~100 MB of debug symbols (.pdb) in the published/archived output —
libSkiaSharp.pdb(84 MB) andlibHarfBuzzSharp.pdb(21 MB) ship as package content and were being zipped into the release.Measured sizes (win-x64):
ObjectEditor.exe108.7 MiB,ObjectEditorUpdater.exe78 MiB, publish folder 307.8 MB, of which 100.7 MB is .pdb.What I changed (verified with real builds)
Gui/Gui.csproj— gated the AvaloniaDiagnosticsSupportdev-tool package to Debug only (the existing comment already said this was intended). Verified: ReleaseObjectEditor.exedropped 108.7 → 107.3 MiB, andAvaloniaUI.DiagnosticsSupport.Avalonia.dllno longer ships.build.sh— added a step that deletes*.pdbfrom all three publish folders before archiving. Verified the Windows publish folder has 100.7 MB of.pdb; removing them cuts the distributed folder from ~307.8 MB → ~207 MB, and the release zip/TAR shrinks correspondingly.What I tested and rejected (so I didn't add noise)
-p:StripSymbols=truefor Linux/macOS: measured zero effect (identical 108.5 MB binary), so I left it out.Recommendations (higher-risk; not applied)
Definitions(e.g., aDefinitions.Databasemodule for the EF Core models/migrations). The GUI only needs the DTOs/ObjectModels, so removing EFC/SQLite/ASP.NET from its dependency closure could save ~10–20 MB per binary. This is the biggest remaining reducible win, but it's a moderate-to-large refactor shared with the server side, so it needs the module's test coverage to validate.--enable-trimming; Avalonia doesn't recommend it for correctness.