Skip to content

[AspireE2E][Aspire CLI]An unexpected error occurred: The JSON-RPC connection with the remote party was lost before the request could complete when dotnet watch on Aspire AppHost projectΒ #13929

@jinzhao1127

Description

@jinzhao1127

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install SDK 10.0.102
  3. Install Aspire.Cli 13.1.0 iex "& { $(irm https://aspire.dev/install.ps1) }"
  4. Enable the hot reload feature in aspire CLI with aspire config set features.defaultWatchEnabled true

REPRO STEPS

  1. Open CMD and create an Aspire Starter App (ASP.NET Core/Blazor)
     dotnet new aspire-starter -o aspire01
     cd aspire01/aspire01.AppHost
    
  2. Run aspire run
  3. Open the URL on browser.
  4. Open AppHost.cs file under xxx.AppHost, and add code .WithReplicas(2); then save the file.
    Image

ACTUAL
The process is shut down and An unexpected error occurred: The JSON-RPC connection with the remote party was lost before the request could complete.
Image

Note:

  1. This issue does not reproduce on Web project and ApiService project

ERROR LOG

❌ An unexpected error occurred: The JSON-RPC connection with the remote party was lost before the request
could complete.
dotnet watch πŸ”₯ Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
dotnet watch πŸ’‘ Press Ctrl+R to restart.
dotnet watch πŸ”¨ Building C:\Users\v-zhajin\Aspire2\Aspire2.Apphost\Aspire2.AppHost.csproj ...
dotnet watch πŸ”¨ Build succeeded: C:\Users\v-zhajin\Aspire2\Aspire2.Apphost\Aspire2.AppHost.csproj
Using launch settings from C:\Users\v-zhajin\Aspire2\Aspire2.Apphost\Properties\launchSettings.json...
info: Aspire.Hosting.DistributedApplication[[0]]
      Aspire version: 13.2.0-preview.1.26064.8+12d27ad489e97bcfa37c074f3fa310643c8dc7f7
info: Aspire.Hosting.DistributedApplication[[0]]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[[0]]
      Application host directory is: C:\Users\v-zhajin\Aspire2\Aspire2.Apphost
info: Aspire.Hosting.DistributedApplication[[0]]
      Now listening on: https://localhost:17017
info: Aspire.Hosting.DistributedApplication[[0]]
      Login to the dashboard at https://localhost:17017/login?t=2aac32108ba777016e1172b8cca5c35e
info: Aspire.Hosting.DistributedApplication[[0]]
      Distributed application started. Press Ctrl+C to shut down.
dotnet watch ⌚ File updated: .\AppHost.cs
dotnet watch πŸ”₯ Restart is needed to apply the changes.
dotnet watch ⌚ [[Aspire2.ApiService (net10.0)]] Exited
dotnet watch ⌚ [[Aspire2.Web (net10.0)]] Exited

EXPECTED
The hot reload should be successfully or restart the app automatically.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions