์ด๋ฒ ๋ฒ์ ์์ ๊ฐ์ฅ ํน์ดํ ์ฌํญ์ ๋ฌด๋ ค Native AOT๋ฅผ ์ง์ํ๋ค๋ ๊ฒ์ ๋๋ค.
๋จผ์ WinUI 3 ํ๋ก์ ํธ๋ฅผ ๋ง๋์๊ณ ,
ํ๋ก์ ํธ ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ด ์์ ํฉ๋๋ค.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.18362.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<WindowsSdkPackageVersion>10.0.18362.35-preview</WindowsSdkPackageVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x64</Platforms>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishAot>true</PublishAot>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bluehill.Imports" Version="1.0.4" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.0-prerelease.240602.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240531000-experimental1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
</Project>
์ด์ publish ํ๋ฉดโฆ
dotnet publish -c Debug -p:Platform=x64
CsWinRT ํจํค์ง ๋๋ฌธ์ธ์ง ์๋๋ ์๋์๋ ์ค๋ฅ๊ฐ ๋์ต๋๋ค.
๋ฐ๋ผ์ ํ๊ฒํ์๋ ์๋์ฐ SDK๋ฅผ ์ค์นํ์ ์ผ ํฉ๋๋ค.
๋ค์ ํ๋ฒ publishํด ๋ณด๋ฉดโฆ
์ด๋ ๊ฒ 9 MB์ง๋ฆฌ ํ์ผ์ด ์์ฑ๋ฉ๋๋ค.
์คํ๋ ๋ฐ๋ก๋ฐ๋ก ์ ์์ ์ผ๋ก ๋ฉ๋๋ค.
์์ฌ์ด ์ ์ WindowsAppSDKSelfContained์ dll๋ค์ ํฌํจ์ด ๋์ง ์๋๋ค๋ ๊ฒ์ ๋๋ค.