c#/winui3

winui 3 create single exe

Choi Jaeho 2024. 1. 8. 13:42
반응형

Prerequirement (how to set unpackaged proejct)

https://jhchoi.tistory.com/23

 

Method 1

(menu)build - publish

 

Method 2

(Soultion Explorer)project : right click - publish

 

Method 3 (.NET CLI / Example)

dotnet publish -c Release -r win10-your_version --self-contained false /p:PublishSingleFile=true /p:PublishProfile=win10-your_version

 

Build Option

project_folder\Properties\PublishProfiles\win10-your_version.pubxml

 

<PublishDir>bin\\YOUR_FOLDER</PublishDir>

<SelfContained>false</SelfContained>                   <!--true includes framework, false does not.-->

<PublishSingleFile>true</PublishSingleFile>    <!--Essential for single exe creation.-->

<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>

<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">true</PublishReadyToRun>

<Configuration>Release</Configuration>

<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework> <!--Your windows version-->

 

Comment

Without framework, it's around 60MB.

with framework, it jumps to about 120MB.

However, WPF or WinForms are around 150KB.
 
 

 

반응형

'c# > winui3' 카테고리의 다른 글

winui 3 net8 unpackaged 프로젝트 환경 설정 하기  (4) 2024.01.04