"--self-contained" always present on the command line #971

Closed
opened 2026-01-29 16:53:27 +00:00 by claunia · 4 comments
Owner

Originally created by @tomshane on GitHub (Feb 28, 2025).

I'm using the latest version and no matter what arguments I add in the command line, I can't get rid of automatically added --self-contained parameter.

I tried:

* electronize build /target win /dotnet-publish --no-self-contained
* electronize build /target win /dotnet-publish --self-contained false
* electronize build /target win /PublishSingleFile false /PublishReadyToRun false /dotnet-publish --self-contained false
* electronize build /target win /PublishSingleFile false /PublishReadyToRun false /dotnet-publish --no-self-contained

Everytime --self-contained is added to the command:

dotnet publish -r win-x64 -c "Release" --output "C:\Downloads\ReactApp2\ReactApp2.Server\obj\desktop\win\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained

Originally created by @tomshane on GitHub (Feb 28, 2025). I'm using the latest version and no matter what arguments I add in the command line, I can't get rid of automatically added --self-contained parameter. I tried: ``` * electronize build /target win /dotnet-publish --no-self-contained * electronize build /target win /dotnet-publish --self-contained false * electronize build /target win /PublishSingleFile false /PublishReadyToRun false /dotnet-publish --self-contained false * electronize build /target win /PublishSingleFile false /PublishReadyToRun false /dotnet-publish --no-self-contained ``` Everytime --self-contained is added to the command: `dotnet publish -r win-x64 -c "Release" --output "C:\Downloads\ReactApp2\ReactApp2.Server\obj\desktop\win\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained`
claunia added the bug label 2026-01-29 16:53:27 +00:00
Author
Owner

@AmbroziuBaban commented on GitHub (Mar 24, 2025):

@tomshane is there an use case in which you wound want the app to be framework dependent and not include it in your build? (aka --no-self-contained)?

I've prepared a PR in case there is a business use case for this.

@AmbroziuBaban commented on GitHub (Mar 24, 2025): @tomshane is there an use case in which you wound want the app to be framework dependent and not include it in your build? (aka --no-self-contained)? I've prepared a PR in case there is a business use case for this.
Author
Owner

@tomshane commented on GitHub (Mar 24, 2025):

I want to make the bundle to be smaller for download and let users download .NET runtime separately, when needed.

@tomshane commented on GitHub (Mar 24, 2025): I want to make the bundle to be smaller for download and let users download .NET runtime separately, when needed.
Author
Owner

@AmbroziuBaban commented on GitHub (Mar 24, 2025):

According to this PR there is already a fix in the Develop branch. Seems like it's using the param /p:SelfContained instead of the usual --self-contained.

Since the ElectronNET.CLI is using the Windows/DOS-style ( / in front of the option), the --self-contained, --no-self-contained, --sc options are not supported.

@AmbroziuBaban commented on GitHub (Mar 24, 2025): According to this [PR](https://github.com/ElectronNET/Electron.NET/pull/847/files) there is already a fix in the Develop branch. Seems like it's using the param /p:SelfContained instead of the usual --self-contained. Since the ElectronNET.CLI is using the Windows/DOS-style ( / in front of the option), the --self-contained, --no-self-contained, --sc options are not supported.
Author
Owner

@FlorianRappl commented on GitHub (Oct 31, 2025):

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

See Wiki / What's New.

@FlorianRappl commented on GitHub (Oct 31, 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#971