Skip to content

Fix Aspire AppHost crash on file upload from Visual Studio#60

Merged
MikeAlhayek merged 5 commits intomainfrom
ma/improve-code
Apr 30, 2026
Merged

Fix Aspire AppHost crash on file upload from Visual Studio#60
MikeAlhayek merged 5 commits intomainfrom
ma/improve-code

Conversation

@MikeAlhayek
Copy link
Copy Markdown
Member

No description provided.

MikeAlhayek and others added 5 commits April 30, 2026 11:23
When Visual Studio launches the Aspire AppHost, it uses dotnet-watch to
monitor child projects for hot reload. File uploads save documents to
App_Data/Documents/ within the project source directory. The file watcher
detects these new files and triggers a project restart, which cascades to
the Aspire host stopping.

DefaultItemExcludes already excludes App_Data from MSBuild item groups
(Content/Compile), but dotnet-watch uses additional file system watchers
that still detect new file creation events. Adding explicit Watch Remove
items tells the watcher to completely ignore the App_Data directory.

This only affected the VS + Aspire scenario because:
- aspire run from CLI does not enable dotnet-watch
- Running projects directly from VS uses a different hot reload path
  that respects DefaultItemExcludes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MikeAlhayek MikeAlhayek merged commit e657e01 into main Apr 30, 2026
8 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/improve-code branch April 30, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant