maui: [Bug] Unable to run maui or maui-blazor template WinUI option from Visual Studio
Description
I create the template, open VS2022, run the WinUI option, and I see an error.
Steps to Reproduce
dotnet new maui-blazor -n MauiBlzor- Open VS2022 and open the MauiBlzor project.
- Select the MauiBlzor entry and debug/run it.
- Observe that it fails due to “target Run does not exist for the project”.
Expected Behavior
Not this. A window should open and show some ui like for the Android emulated version.
Actual Behavior
msbuild process errors.
Basic Information
- Version with issue: Fresh VS2022 preview 7 install with all extra MAUI bits.
- Last known good version: Never run it.
- IDE: VS2022 preview 7
- Platform Target Frameworks:
- iOS:
- Android:
- UWP:
- Android Support Library Version:
- Nuget Packages:
- Affected Devices:
Screenshots

Reproduction Link
See the steps above.
Workaround
There is another issue on maui-samples talking about using --no-restore but that is on the command-line, and does not apply here as there is no place for me to put it in the VS2022 UI that I understand.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 24 (15 by maintainers)
This is what happens when I set that as startup and debug it.
@rt121212121 yup, understood, this is definitely a frustrating issue right now but I just heard there is a fix for this coming soon.
@rt121212121 ah, that might be a current issue with VS and WinUI projects. Can you right-click on the WinUI project and select “Deploy” and then run the app from the Windows Start Menu? Please see the note at the end of the preview 7 blog post: https://devblogs.microsoft.com/dotnet/announcing-net-maui-preview-7/#feedback-welcome
Yes, it runs from the start menu, I classify that as “deploy works”. It would be good if you could document all these foibles and provide people one easy place to go do, as I spent quite a bit of time burning attention and willpower to play with this. I’m quite excited about Maui, and can see the potential of the blazor approach and am looking forward to when it’s all in shape.
Yes, deploy works, just tested with MauiBlazor template.
@Almis90 if the Deploy option isn’t showing up, it could be that you need to install this VS extension: https://marketplace.visualstudio.com/items?itemName=ProjectReunion.MicrosoftSingleProjectMSIXPackagingToolsDev17
For some reason I don’t see the deploy option on WinUI project, it is available only for the other project without the appendix