How to migrate UWP .Net Native to UWP AOT

Hong 1,566 Reputation points
2026-09-08T14:08:26.9033333+00:00

I read the official document on "Modernize your UWP app with .NET and Native AOT". The instructions for migrating .Net Native UWP to the new modern UWP are sketchy. It seems that one can just edit the existing .csproj to do the migration.

Specifically, change the root element to

<Project Sdk="Microsoft.NET.Sdk">

Then add the following PropertyGroup:

  <PropertyGroup>     <OutputType>WinExe</OutputType>     <TargetFramework>net10.0-windows10.0.26100.0</TargetFramework> <!-- Use the latest supported .NET version -->     <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>     <UseUwp>true</UseUwp>     <EnableMsixTooling>true</EnableMsixTooling>     <PublishAot>true</PublishAot>     <DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>

Could anyone point me to a source with detailed instructions?

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments

Answer accepted by question author
Gatlin Le (WICLOUD CORPORATION) 160 Reputation points Microsoft External Staff Moderator
2026-09-10T04:12:12.6833333+00:00

Hi @Hong ,

Thank you for the clarification and for sharing the project file — that helps a lot.

From what is visible in your screenshot, here is how I would approach it:

Most of what you're seeing can go

  • Both Import statements — Microsoft.Common.props at the top of the file and Microsoft.Windows.UI.Xaml.CSharp.targets near the bottom. The SDK brings these in itself, and leaving them will cause conflicts.
  • All the per-configuration blocks (Debug and Release across x86, x64, ARM): OutputPath, DebugType, DebugSymbols, ErrorReport, Prefer32Bit, UseVSHostingProcess. The SDK has sensible defaults for each of these. One caveat — these blocks also hold your DefineConstants, so note those down before deleting. If your code has #if conditions relying on them, you'll want to confirm they still resolve on the new target framework.
  • Any ItemGroup that simply lists your .cs files, XAML pages or image assets by name — those are picked up automatically now.

What's specific to your app is worth carrying over

  • PackageReference entries, updated to Native AOT–compatible versions. If you're still on packages.config, bring across only the direct references; transitive ones resolve on their own.
  • ProjectReference entries.
  • Files with a non-default build action, or anything using CopyToOutputDirectory.
  • Your app identity and AppxManifest-related configuration.

One suggestion worth considering: Visual Studio 2026 includes templates for modern UWP apps, and starting fresh then copying your source and assets over is often less painful than editing the old file down — if the build breaks, you know it's your code rather than a leftover setting. Editing in place keeps your git history, so either approach is fine.

Either way, please back up first and rebuild after each chunk of changes rather than all at once.

Happy to go through it line by line if you paste the full .csproj as text with anything sensitive removed.

Was this answer helpful?

2 people found this answer helpful.

2 additional answers

Sort by: Newest
  1. Vignesh vicky 0 Reputation points
    2026-09-09T04:58:11.8466667+00:00

    Yes, the migration mainly involves updating the .csproj file to the modern UWP SDK-style project format and adding the required properties. However, check Microsoft’s “Modernize your UWP app with .NET and Native AOT” documentation for the complete requirements and limitations.

    Was this answer helpful?

    1 person found this answer helpful.

  2. Bruce (SqlWork.com) 85,281 Reputation points
    2026-09-08T14:45:05.9466667+00:00

    While updating the project file is key first step, you need to update your nuget packages to native aot compatible versions also. If the nuget package is not under current development, it may need to be replaced. Third you may need to edit code that fails to compile to AOT.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.