You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple aspnetcore backend and blazor wasm standalone frontend setup with aspire.
AppHost Program.cs
var builder = DistributedApplication.CreateBuilder(args);
var api = builder.AddProject<Projects.Debtware_Client_Portal_Api>("api");
var ui = builder.AddProject<Projects.Debtware_Client_Portal>("ui").WithReference(api).WaitFor(api);
builder.Build().Run();
I am running the whole application using dotnet watch on Aspire AppHost project.
dotnet watch startup output
PS [REDACTED_PATH]> dotnet watch --property WarningLevel=0
dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
💡 Press "Ctrl + R" to restart.
dotnet watch ⌚ Building [REDACTED_PATH]\Revive.AppHost.csproj ...
dotnet watch 🔨 Build succeeded: [REDACTED_PATH]\Revive.AppHost.csproj
Using launch settings from [REDACTED_PATH]\Properties\launchSettings.json...
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 9.2.0+0fcb1e9885266c1700c49c16513a6d97480bb058
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: [REDACTED_PATH]
info: Aspire.Hosting.DistributedApplication[0]
Now listening on: https://localhost:17243
info: Aspire.Hosting.DistributedApplication[0]
Login to the dashboard at https://localhost:17243/login?t=78a9e160d0643e70a21fc9a73be7c4cc
info: Aspire.Hosting.DistributedApplication[0]
Distributed application started. Press Ctrl+C to shut down.
Using launch settings from [REDACTED_PATH]\Properties\launchSettings.json...
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:54175
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: [REDACTED_PATH]
However, when making standard hot reload changes to the WASM project (not dirty, or dirty), then the change succeeds, and follows up immediately crashing the whole program.
See the output & stacktrace here
dotnet watch ⌚ File updated: [REDACTED_PATH]\IACustomerPackSection.razor
dotnet watch 🔥 [Debtware.Client.Portal.Api (net9.0)] Hot reload succeeded.
dotnet watch 🔥 [Debtware.Client.Portal (net9.0)] Hot reload succeeded.
dotnet watch ❌ [Debtware.Client.Portal.Api (net9.0)] Exited with error code -1
dotnet watch ❌ [Debtware.Client.Portal (net9.0)] Exited with error code -1
dotnet watch ❌ [Revive.AppHost (net9.0)] Exited with error code -1
dotnet watch ❌ System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DotNet.Watch.BlazorWebAssemblyDeltaApplier.Apply(ImmutableArray`1 updates, CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.BlazorWebAssemblyHostedDeltaApplier.Apply(ImmutableArray`1 updates, CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.CompilationHandler.<>c__DisplayClass20_0.<<HandleFileChangesAsync>b__2>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.DotNet.Watch.CompilationHandler.HandleFileChangesAsync(Func`3 restartPrompt, CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.Program.RunAsync()
dotnet watch ❌ An unexpected error occurred
Expected Behavior
The hot reload succeeds without crashing the entire apphost process.
Steps To Reproduce
I got an even earlier error while setting up a minimal repro.
I created this project https://github.com/Hona/AspireWasmCrash
Then - dotnet run on the host starts fine and the UI is responsive.
Then - dotnet watch on the host errors immediately.
dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
💡 Press "Ctrl + R" to restart.
dotnet watch ⌚ Building C:\Repos\AspireWasmCrash\AspireWasmCrash\AspireWasmCrash.csproj ...
dotnet watch 🔨 Build succeeded: C:\Repos\AspireWasmCrash\AspireWasmCrash\AspireWasmCrash.csproj
dotnet watch ❌ [AspireWasmCrash (net9.0)] Exited with error code -1
dotnet watch ❌ System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DotNet.Watch.BlazorWebAssemblyDeltaApplier.WaitForProcessRunningAsync(CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.RunningProject.WaitForProcessRunningAsync(CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.Program.RunAsync()
dotnet watch ❌ An unexpected error occurred
PS C:\Repos\AspireWasmCrash\AspireWasmCrash> dotnet run
Using launch settings from C:\Repos\AspireWasmCrash\AspireWasmCrash\Properties\launchSettings.json...
Building...
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 9.0.0+01ed51919f8df692ececce51048a140615dc759d
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: C:\Repos\AspireWasmCrash\AspireWasmCrash
info: Aspire.Hosting.DistributedApplication[0]
Now listening on: https://localhost:17078
info: Aspire.Hosting.DistributedApplication[0]
Login to the dashboard at https://localhost:17078/login?t=d86d6d466f55d44a04ccffb4fedee39e
info: Aspire.Hosting.DistributedApplication[0]
Distributed application started. Press Ctrl+C to shut down.
Is there an existing issue for this?
Describe the bug
I have a simple aspnetcore backend and blazor wasm standalone frontend setup with aspire.
AppHost Program.cs
I am running the whole application using
dotnet watch
on Aspire AppHost project.dotnet watch startup output
PS [REDACTED_PATH]> dotnet watch --property WarningLevel=0
dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
💡 Press "Ctrl + R" to restart.
dotnet watch ⌚ Building [REDACTED_PATH]\Revive.AppHost.csproj ...
dotnet watch 🔨 Build succeeded: [REDACTED_PATH]\Revive.AppHost.csproj
Using launch settings from [REDACTED_PATH]\Properties\launchSettings.json...
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 9.2.0+0fcb1e9885266c1700c49c16513a6d97480bb058
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: [REDACTED_PATH]
info: Aspire.Hosting.DistributedApplication[0]
Now listening on: https://localhost:17243
info: Aspire.Hosting.DistributedApplication[0]
Login to the dashboard at https://localhost:17243/login?t=78a9e160d0643e70a21fc9a73be7c4cc
info: Aspire.Hosting.DistributedApplication[0]
Distributed application started. Press Ctrl+C to shut down.
Using launch settings from [REDACTED_PATH]\Properties\launchSettings.json...
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:54175
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: [REDACTED_PATH]
However, when making standard hot reload changes to the WASM project (not dirty, or dirty), then the change succeeds, and follows up immediately crashing the whole program.
See the output & stacktrace here
Expected Behavior
The hot reload succeeds without crashing the entire apphost process.
Steps To Reproduce
I got an even earlier error while setting up a minimal repro.
I created this project https://github.com/Hona/AspireWasmCrash
Then -
dotnet run
on the host starts fine and the UI is responsive.Then -
dotnet watch
on the host errors immediately.Here is the output of both combined.
run vs watch output
PS C:\Repos\AspireWasmCrash\AspireWasmCrash> dotnet watch --property WarningLevel=0
dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
💡 Press "Ctrl + R" to restart.
dotnet watch ⌚ Building C:\Repos\AspireWasmCrash\AspireWasmCrash\AspireWasmCrash.csproj ...
dotnet watch 🔨 Build succeeded: C:\Repos\AspireWasmCrash\AspireWasmCrash\AspireWasmCrash.csproj
dotnet watch ❌ [AspireWasmCrash (net9.0)] Exited with error code -1
dotnet watch ❌ System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DotNet.Watch.BlazorWebAssemblyDeltaApplier.WaitForProcessRunningAsync(CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.RunningProject.WaitForProcessRunningAsync(CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.HotReloadDotNetWatcher.WatchAsync(CancellationToken shutdownCancellationToken)
at Microsoft.DotNet.Watch.Program.RunAsync()
dotnet watch ❌ An unexpected error occurred
PS C:\Repos\AspireWasmCrash\AspireWasmCrash> dotnet run
Using launch settings from C:\Repos\AspireWasmCrash\AspireWasmCrash\Properties\launchSettings.json...
Building...
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 9.0.0+01ed51919f8df692ececce51048a140615dc759d
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: C:\Repos\AspireWasmCrash\AspireWasmCrash
info: Aspire.Hosting.DistributedApplication[0]
Now listening on: https://localhost:17078
info: Aspire.Hosting.DistributedApplication[0]
Login to the dashboard at https://localhost:17078/login?t=d86d6d466f55d44a04ccffb4fedee39e
info: Aspire.Hosting.DistributedApplication[0]
Distributed application started. Press Ctrl+C to shut down.
Exceptions (if any)
No response
.NET Version info
Anything else?
No response
The text was updated successfully, but these errors were encountered: