I have written a small console application in C# which uses native AOT from .NET 7.0. Native AOT works perfectly for .exe deployments and drastically reduces startup times.
My project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>console-application</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
</PropertyGroup>
</Project>
Now I would like to package my application as MSIX or APPX so that I can upload it to the Microsoft Store. I tried using a Windows Application Packaging Project (Documentation). In my Package.appxmanifest
I could easily add an execution alias (Documentation).
The packaged application works. However, it does not use native AOT, no trimming and no single file deployment. I tried to add <RuntimeIdentifier>
, <SelfContained>
, and <PublishSingleFile>
to my project file but the packaging project seems to ignore these settings, although they are respected by dotnet publish
.
Is there a way to force a Windows Application Packaging Project to use native AOT?