Skip to content

AppHost crashes in Visual Studio when a browser file picker opens and launchBrowser is enabled #17888

@MikeAlhayek

Description

@MikeAlhayek

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

My web app supports file uploads and works correctly in all of these cases:

  • running the site directly outside Aspire
  • running the Aspire app with aspire run
  • running the Aspire app with aspire run --debug

The crash only happens when I start the Aspire AppHost from Visual Studio and the AppHost launch profile haslaunchBrowser set to true.

As soon as I click the browser's Browse button for a file upload and select a file (or close the file picker),the AppHost crashes and the Visual Studio debug session stops.

If I set launchBrowser to false, the crash no longer happens.

This makes it look like a Visual Studio + Aspire dashboard/browser-launch integration issue rather than an issue inmy app's upload code.

Exceptions (if any)

I don't see this when running outside Visual Studio.
The behavior appears tied to the Visual Studio launch/debug path.

Anything else?

  • Works when running the site directly
  • Works with aspire run
  • Works with aspire run --debug
  • Stops reproducing when launchBrowser is set to false

This seems related to the same family of issues as:

Expected Behavior

  1. Start the Aspire AppHost from Visual Studio with a launch profile where launchBrowser is true
  2. Open the site that contains a file upload control
  3. Click Browse
  4. Select a file or close the file picker dialog
  5. Observe that the AppHost crashes and Visual Studio stops debugging

If you want a repo, Clone OrchardCore then change branches to ma/upload-file-scanner and tun the Aspire Host in Visual Studio project OrchardCMS/OrchardCore#19329 But you'll need to set launchBrowser to stru in the launchSettings.json file.

Steps To Reproduce

No response

Exceptions (if any)

No response

Aspire doctor output

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions