When I try to build a MUAI project, it gives the error “The project doesn't know how to run the profile sample.WinUI". The project gets built but it doesn't run. I am using Visual Studio 2022 Preview(17.0.0 Preview 1.0) and .NET version 6.0.100-preview.5.21302.13
-
This is still an issue for me with VS 2022 preview 3 and .NET 6 preview 6. Note that in VS 2021 the solution was to right click the WinUI project and "Deploy" but this option is not present in 2022.Ant– Ant2021-07-15 11:33:44 +00:00Commented Jul 15, 2021 at 11:33
-
This may related to the "Development tools for .NET" component of the Visual Studio installation. See VS2022 - The project doesn't know how to run the profile and How to fix "The project doesn't know how to run the profile ConsoleREPL" in Visual Studio? - Microsoft Q&A.li ki– li ki2022-11-10 07:07:20 +00:00Commented Nov 10, 2022 at 7:07
Add a comment
|
1 Answer
Haven't found this documented yet, but it turns out you need to install the 2022 equivalent of Single-project MSIX Packaging Tools for VS 2019. You can find the 2022 version here:
Single-project MSIX Packaging Tools for VS 2022
Once installed you can build the WinUI project then right-click and select Deploy. Debugging and running should then work as expected.
3 Comments
DarthVegan
I tried your suggestion but it didn't work for me. I'm trying to debug a windows console application and I'm getting the same exact error message as the op
Ant
@DarthVegan this answer is specific to preview releases of .Net 6 MAUI projects. Seeing this error in other contexts would suggest you don't have the right project selected as the startup project.
DarthVegan
I only have a single project in the solution which of course is the startup