There’s a bit of fanfare going on at the moment because Microsoft have released the first preview of Visual Studio 2022 (announcement / download) which is significant because this is the first version of Visual Studio which will be 64bit. Note, this isn’t the first version that supports 64bit development, it’s the first version where the IDE itself is 64bit.
After downloading the preview the first thing I wanted to try out was creating a Project Reunion / Windows UI (WinUI) application. Unfortunately the extensions for Project Reunion aren’t part of the Visual Studio 2022 installer. What’s worse is that neither the stable or preview version of the Project Reunion extensions are compatible with Visual Studio 2022. You’d think this would be somewhere on the priority list, right?
Anyhow, luckily all is not lost, since the extensions are really just a bunch of application/library templates. In order to develop your WinUI application in Visual Studio 2022, all you need to do is create your application in Visual Studio 2019 (either stable or preview builds are fine) and then open your solution in Visual Studio 2022.
That’s it – there’s nothing else you need to do.
If you’re having issues creating a new WinUI application in Visual Studio 2019, you may be running into .NET sdk related issues. Follow the instructions here to target the .NET 5 sdk that you have installed.