How to migrate UWP .Net Native to UWP AOT

Hong 1,546 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

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 85,276 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

  2. 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?


  3. Gatlin Le (WICLOUD CORPORATION) 0 Reputation points Microsoft External Staff Moderator
    2026-09-09T03:27:33.5066667+00:00

    Hi @Hong ,

    Thank you for taking the time to review the migration documentation and for raising this question.

    Based on the information currently available, migrating a UWP application from .NET Native to UWP with Native AOT is a supported scenario. However, updating the project file alone is typically only the first step of the migration process.

    While many applications may migrate successfully after the required project configuration changes, the overall experience can vary depending on the application's dependencies and implementation details. For example, it is important to verify that all NuGet packages used by the application are compatible with Native AOT, and some code changes may be required if the application relies on APIs or patterns that are not fully compatible with AOT compilation.

    As Bruce mentioned, package compatibility and potential code updates should also be evaluated as part of the migration effort.

    At this stage, without reviewing a specific project or encountering particular build/publish errors, it is difficult to predict whether any issues will arise during the migration. If you proceed with the migration and run into build, publish, or runtime errors, please feel free to share the details and we will be happy to investigate further.

    I hope this helps clarify the migration expectations and potential considerations. If you found my response helpful or informative, I would greatly appreciate it if you could share your thoughts by reacting to this answer or leaving a comment.

    Thank you.

    Was this answer helpful?


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.