dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.99k stars 1.72k forks source link

[Windows, 9.0 Preview 7] Debugger crashes the app on Windows almost immediately in debug configuration #24293

Open janne-hmp opened 3 weeks ago

janne-hmp commented 3 weeks ago

Description

When trying to debug my app on Windows in 9.0 Preview 7, the debugger crashes almost immediately, crashing the app as well. Preview 6 works fine.

image

Steps to Reproduce

  1. Try to debug GnollHackM on Windows
  2. The debugger crashes almost immediately along with the app

Link to public reproduction project repository

https://github.com/hyvanmielenpelit/GnollHack

Version with bug

9.0.0-preview.7.24407.4

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.0-preview.6.24327.7

Affected platforms

Windows

Affected platform versions

Windows 10.0.22631

Did you find any workaround?

No. Cannot use the debugger on Windows.

Relevant log output

No response

github-actions[bot] commented 3 weeks ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

janne-hmp commented 3 weeks ago

The exception does not always seem to be the same:

image

QianaJiao commented 3 weeks ago

Verified this issue with the provided repo on windows platform, it works fine on 17.12.0 Preview 1.0 (9.0.0-preview.6.24327.7) and get crashes on 17.12.0 Preview 2.0 [35212.213.main] (9.0.0-preview.7.24408.5).

The template MAUI project would not have this issue.

janne-hmp commented 2 weeks ago

This seems to be a problem with VS 2022 17.12.0 Preview 1 in my case. On VS 2022 17.11.1, the Maui debugger on Windows works fine.

janne-hmp commented 2 weeks ago

In fact, after more testing, I do get eventually the crash with the debugger also in VS 2022 17.11.1, but not as nearly as fast / immediately as in VS 2022 17.12.0 Preview 1.

drasticactions commented 2 weeks ago
スクリーンショット 2024-08-28 13 31 10

Going by the stack, at some point the WinUITap (That's XAML Hot Reload code) is invoked. I'm not sure if that's related to your crash here but that seems suspect. @janne-hmp Could you try turning off XAML Hot Reload to see if it lets it through?

@etvorun Would you have any ideas here?

janne-hmp commented 2 weeks ago

I switched off the following Hot Reload features in Tools > Options:

and then the problem seems to be fixed. Thanks a lot!

etvorun commented 1 day ago

This seems to be WinUI bug. I created https://github.com/microsoft/microsoft-ui-xaml/issues/9982 to track it. BTW less invasive workaround is to disable in-app toolbar image