microsoft / microsoft/aspire

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

Open
#17,888 2 comments 1 reaction 0 assignees View on GitHub
area-tooling triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Description

### Is there an existing issue for this?

- [x] 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 has`launchBrowser` 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:
- #7998
- #8355

### 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](https://github.com/OrchardCMS) then change branches to `ma/upload-file-scanner` and tun the Aspire Host in Visual Studio project https://github.com/OrchardCMS/OrchardCore/pull/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_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash from the OrchardCore branch in Visual Studio with the AppHost launchSettings.json launchBrowser value set to true, then compare it with aspire run, aspire run --debug, and launchBrowser set to false. Use issues #7998 and #8355 as related context; done means opening or closing the browser file picker no longer crashes the AppHost or stops debugging.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.