Modernize your UWP app with preview UWP support for .NET 9 and Native AOT #9983
Replies: 15 comments 57 replies
-
This is amazing, you've really made my day with this announcement. The application I develop has been stuck waiting for InkCanvas support in WinUI 3, and gradually a few of our libraries have been dropping .net standard 2.0 support, leaving us to maintain our own forks. I have a small question regarding ARM64 support as I'm using a Surface Pro 11 as my main development machine. The "Project Templates for UWP projects targeting .net 9 and Native AOT" VSIX in the blog doesn't seem to support ARM64 versions of Visual Studio, is there a chance that we'll see support for that in the future? Additionally, I'm curious to know if the support for .net 9 means that we'll be able to debug on ARM64 natively. At the moment I'm compiling to X64 and it works well, but it would be nice to get rid of the emulation layer if possible, as I can't currently run the app on ARM64 natively without a .NET Native build. Again, thank you all SO... SO MUCH. |
Beta Was this translation helpful? Give feedback.
-
Currently my project builds faster using .NET Native in Release configuration than using .NET 9 with AOT in Debug configuration. |
Beta Was this translation helpful? Give feedback.
-
First, thank you very much!
I'm getting an "Operation is not valid due to the current state of the object." error when creating the project from the VS template. I'm not sure if the following issue is because of this error. App won't build with the following. I tried installing the 8.0.4 System.Text.Json, but can't resolve the error. NETSDK1060 Error reading assets file: Error loading lock file 'C:\Users\Carlo\source\repos\APP UWP with NET 9 Test 1\APP UWP with NET 9 Test 1\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. APP UWP with NET 9 Test 1 C:\Program Files\dotnet\sdk\9.0.100-rc.2.24466.31\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 266 |
Beta Was this translation helpful? Give feedback.
-
Will it be supported on Xbox? |
Beta Was this translation helpful? Give feedback.
-
I tried out the preview and it is overall working great! Here are some issues I observe (I use a UWP app + win32 helper with a separate packaging project)
|
Beta Was this translation helpful? Give feedback.
-
So with the release of RC2 does this process change? |
Beta Was this translation helpful? Give feedback.
-
does this mean that UWP is comming back as GDKs account barriere makes it a bad option for xbox support and UWP was fine for that ? |
Beta Was this translation helpful? Give feedback.
-
I am currently trying to upgrade a pretty large project to modern UWP. It’s a bit tedious because most referenced UWP packages can’t be used as they are and need to be adjusted locally. Right now, i use local builds amongst others of
So far i recognized several issues (in no particular order)
Overall, the preview does pretty good for what i was waiting for years ❤️. I am still far from getting my project running though. |
Beta Was this translation helpful? Give feedback.
-
I want to come back to an issue that @lhak described above: content files of an UWP app are packaged at a different path in a separate wapproj. They moved into an |
Beta Was this translation helpful? Give feedback.
-
I've followed migrations steps from the article, installed .NET SDK 9.0.200-preview.0.24527.8 and Windows SDK 10.0.26100.1742 and encountered a few issues that I hope you can help address:
|
Beta Was this translation helpful? Give feedback.
-
Hi, I work for a company where we have created a line of business UWP app (not in the Store) over the last 7 years. Just the other day we were discussing the process for moving from UWP to an app developed with WindowsApp SDK, and all the issues that would entail. This new UWP for .Net 9 project has come at just the right time for us, as it will provide a more step by step approach to migration, allowing us to migrate firstly to .Net 9, then to WinUI3, and finally to the full Win32 model. I've installed VS2022 17.12 Preview 5 and all .Net Desktop and Windows App development components, the latest Windows 11 SDK version 10.0.26100.1742, and also the VSIX for the templates. On creating a new UWP for .Net 9 project, I'm getting the following error on build: Microsoft.UI.Xaml.Markup.winmd cannot be referenced. Referencing a Windows Metadata component directly when targeting .NET 5 or higher is not supported. For more information, see https://aka.ms/netsdk1130 This is literally from creation of a new project. No changes made at all. I've rebooted, double checked the installed VS2022 17.12 Preview components, all is as it should be. Can anyone help diagnose or help fix this issue? These are the dependencies that are added by default: I notice that under Packages, the SDK BuildTools are version 10.0.22621, is that correct? Is this the same version that everyone else has? |
Beta Was this translation helpful? Give feedback.
-
First stumbling block, converting one of our class libraries, in our large UWP app, is that is uses the following nuGet package: Microsoft.UI.Xaml.Behaviors.Uwp.Managed However this cannot be installed in a UWP for .Net 9 class library, as it says it's not compatible with .Net 9. An alternative I could use is the following nuGet package: CommunityToolKit.UWP.Behaviors However, whilst that installs, it causes the following error: The type or namespace name 'Xaml' does not exist in the namespace 'Uno.UI' (are you missing an assembly reference?) as it seems that the package is dependent on the Uno.UI package, which is listed in the package manifest as a .net 8 dependency. Installing the Uni.UI nuget package manually, just results is many more errors :-( I guess this are the kinds of issues that are going to crop up as people migrate their UWP apps. It's not the fault of the nuGet package developers that they don't support .Net 9, nor that they for some reason have a dependency on the Uno.UI nuGet package, which is very incompatible with UWP for .Net 9 Other than stripping out functionality from our UWP app, that relies on XAML behaviors, I'm not sure how I can make this functionality work. |
Beta Was this translation helpful? Give feedback.
-
Now that .NET9 is released how should we start? Will the Upgrade Assistant be updated to include the new UWP project format? Or do we have to create a new project on our own and copy the files to the new project? |
Beta Was this translation helpful? Give feedback.
-
Just tried to create a UWP project with .net 9 and the latest VS release. Microsoft.UI.Xaml.Markup.winmd cannot be referenced. Referencing a Windows Metadata component directly when targeting .NET 5 or higher is not supported. For more information, see https://aka.ms/netsdk1130 Which version of this should be used??
Is the nuget.config change still required? Never mind, I didn't realize I needed to leave the SDK version at the latest. Works! |
Beta Was this translation helpful? Give feedback.
-
Working steps with latest of everything are: Install Visual Studio 2022 version 17.12.0, install .Net 9 SDK, install UWP .Net 9 support VSIX, select this template select this target version add this to your project file
So you wind up with this:
|
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
We recently announced preview UWP support for .NET 9, described in detail on the #ifdef Windows blog here: Modernize your UWP app with preview UWP support for .NET 9 and Native AOT. This is an effort to help you with the following:
🚨 Please use this post to provide community feedback, ask questions, and discuss preview UWP support for .NET 9. 🚨
If you hit any issues while trying it out, use the following channels to report them:
Thank you, and we're looking forward to hearing from you!
Beta Was this translation helpful? Give feedback.
All reactions