Add PublishTrimmed option #743

Closed
opened 2026-01-29 16:47:25 +00:00 by claunia · 2 comments
Owner

Originally created by @aikrana on GitHub (Dec 20, 2021).

Would be nice to add this option (as well as PupblishSingleFile was) to reduce the exe file size in windows

Originally created by @aikrana on GitHub (Dec 20, 2021). Would be nice to add this option (as well as PupblishSingleFile was) to reduce the exe file size in windows
claunia added the Feature label 2026-01-29 16:47:26 +00:00
Author
Owner

@m3nax commented on GitHub (Apr 7, 2022):

You can add the option to the project configuration file.

Example of file.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <PublishTrimmed>true</PublishTrimmed>
    <TrimMode>CopyUsed</TrimMode>
  </PropertyGroup>
</Project>

After that the command dotnet electronize build /target win produce a trimmed assembly.

NOTE: I haven't tested the other target platforms.

@m3nax commented on GitHub (Apr 7, 2022): You can add the option to the project configuration file. Example of `file.csproj` ``` xml <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> <PublishTrimmed>true</PublishTrimmed> <TrimMode>CopyUsed</TrimMode> </PropertyGroup> </Project> ``` After that the command `dotnet electronize build /target win` produce a trimmed assembly. NOTE: I haven't tested the other target platforms.
Author
Owner

@FlorianRappl commented on GitHub (Nov 1, 2025):

Outdated - use ElectronNET.Core and ElectronNET.Core.AspNet.

See Wiki / What's New.

@FlorianRappl commented on GitHub (Nov 1, 2025): Outdated - use `ElectronNET.Core` and `ElectronNET.Core.AspNet`. See [Wiki / What's New](https://github.com/ElectronNET/Electron.NET/wiki/What's-New).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#743