Skip to content

WinUI WebView2 causes crash with HTML input file while debugging after 30 seconds #3551

@Eilon

Description

@Eilon

Description

A WinUI app with WebView2 that hosts HTML with an <input type="file" ... /> element will cause the app to crash and not able to debug it.

Version
SDK:
Runtime:
Framework:
OS:

Repro Steps

  1. Create new WinUI3 Packaged app
  2. Change the main XAML to be <WebView2 Source="https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_file"></WebView2> (and remove any other code from the CS file that isn't relevant)
  3. Run the app from VS with the debugger (press F5)
  4. In the app click the "Choose file" in the loaded HTML page
  5. Don't pick any files. Just wait a minute or two.

Result: The app will crash and you cannot debug it. If you try to debug it, you get all kinds of weird exceptions from VS itself (and it weirdly loads in Dark Mode... no idea why).

Expected: No crash.

Screenshots

image

Additional context

This does not repro in these similar scenarios:

  • WinUI app run without the debugger doesn't crash
  • WinUI app run from Start Menu doesn't crash
  • WPF + WebView2 doesn't crash

AB#44977210

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtrackedWe are tracking this work internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions