See the question and my original answer on StackOverflow

FWIW, the issue I describe here happens for all WinUI3 projects (so for MAUI projects too I guess). It took me a while to figure what was going on, as I had the "Deploy" configuration checked, but still getting that "please enable deploy in the Configuration Manager" error...

It turns out it also depends on how you've configured the debugger start project.

So, for example, if you don't have not set the WindowsPackageType property (running as "packaged), then you must use the Visual Studio debugger entry postfixed with "(Package)":

WindowsPackageType unset

While if you've set WindowsPackageType to None, then you must use the entry postfixed with "(Unpackaged)"

WindowsPackageType set to None

It seems obvious but only while you know it...