Search code examples
mauimaui-windows

Can't debug Maui project with target project as Windows


I've tested out my Maui project on Android and it works perfectly fine.

Now, I've been trying to test it out on Windows, but as soon as I start the application, the application closes. The output log also shows 2147942405 exit code. I've tried to run the application as admin and I've also opened up Visual Studio as admin but it's not been a help.

Is there something else I should do?


Solution

  • At first, did you try to create a new maui project and debug it on the windows? In addition, is your pc's system windows 10? If so, it seems an existed issue which is about MAUI apps crash on launch on Windows after Visual Studio update - code 2147942405 on the github.

    And you can try the workaround in this issue which tried to download the Microsoft.WindowsAppRuntime.Redist.1.2.zip and run its WindowsAppRuntimeInstall.exe (as admin) .

    Finally, you can follow up this issue on the github.