Skip to content

aspire run hangs on build errors when using defaultWatchEnabled #13142

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using the feature flag defaultWatchEnabled: true, whenever there's a build errors in the solution aspire run will hang on "Connecting to apphost..." until exiting manually.

Expected Behavior

aspire run should exit and show there's a build error.

Steps To Reproduce

Put this in .aspire/settings.json, introduce a build error anywhere in the solution and run aspire run.

"features": {
    "defaultWatchEnabled": true
  }

Exceptions (if any)

No response

.NET Version info

.net 10 ga

Anything else?

aspire 13.0.0 and 13.1.0-preview.1.25572.6
vscode
devcontainer

Activity

  1. changed the title [-]aspire run hides build errors when using defaultWatchEnabled[/-] [+]aspire run hangs on build errors when using defaultWatchEnabled[/+] on Nov 23, 2025
  2. bardkalbakk commented on Feb 25, 2026

    @bardkalbakk

    Same, it's because the dotnet watch process doesnt exit after build fails, and aspire fails to detect the build error.

    Notice the second last line in the output below.

    From aspire run -d with defaultWatchEnabled set in .aspire/settings.json:

    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch 🔨 Build FAILED.
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch 🔨 
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch ❌[Redacted] (94,46): error CS0246: The type or namespace name '[Redacted]' could not be found (are you missing a using directive or an assembly reference?) [[Redacted]]
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch ❌ [Redacted] (95,44): error CS0246: The type or namespace name '[Redacted]' could not be found (are you missing a using directive or an assembly reference?) [[Redacted]]
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch 🔨     0 Warning(s)
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch 🔨     2 Error(s)
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch 🔨 
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch 🔨 Time Elapsed 00:00:09.09
    [10:38:08] [dbug] DotNetCliRunner: dotnet(13576) stderr: dotnet watch ⏳ Waiting for a file to change before restarting ...
    [10:38:08] [dbug] AppHostCliBackchannel: Connecting to AppHost backchannel at C:\Users\BårdKalbakk\.aspire\cli\backchannels\cli.sock.5233fde4169144fc8877e7621725bb54
    

    aspire version: 13.1.1+6c6cd23e4d6e647d17a9689c3104dcbd21f42fb5
    .net version: 10.0.103

  3. dsurys commented on Apr 7, 2026

    @dsurys

    Still happens in 13.2.1 after putting

    "features": {
        "defaultWatchEnabled": true
      }

    into aspire.config.json as it replaced ./.aspire/settings.json

    AppHost eventually starts if the compilation errors are fixed and files saved.

  4. Bertolossi commented on May 2, 2026

    @Bertolossi
    Contributor

    CLI was skipping its pre-build in watch mode and dotnet watch doesn't exit on build errors, so the CLI hung on the backchannel. PR makes the CLI always pre-build so failures surface immediately

  5. added this to the 13.4 milestone on May 3, 2026
  6. added a commit that references this issue on May 11, 2026
    9b297c9
  7. added a commit that references this issue on May 18, 2026
    2122f8d
  8. locked and limited conversation to collaborators on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions