A standalone repro/playground for experimenting with the Microsoft.DotNet.HotReload.Watch.Aspire package and Aspire-hosted .NET services.
src/AspireWatchDemo.Starter— restores the.slnxsolution, locates the restored Watch.Aspire payload, and launches it against the AppHost.src/AspireWatchDemo.AppHost— an Aspire AppHost that usesAddExecutable()to start the demo services.src/AspireWatchDemo.ApiService— a small watched ASP.NET Core service onhttp://127.0.0.1:5071.src/AspireWatchDemo.Web— a second watched ASP.NET Core service onhttp://127.0.0.1:5072.src/AspireWatchDemo.Shared— shared code used by both services.src/AspireWatchDemo.WatchBootstrap— shared utility code for locating the Watch.Aspire tool payload and the active SDK.
From the repo root:
dotnet run --project src/AspireWatchDemo.StarterThe starter will:
- run
dotnet restoreagainstAspireWatchDemo.slnx - locate
Microsoft.DotNet.HotReload.Watch.Aspire - launch the AppHost through the restored watch binary
You can also point the starter app to local repository with Aspire watch tool:
dotnet run --project src/AspireWatchDemo.Starter -- --use-private-watch-aspire C:\Users\karolz\code\dotnetsdk\src\Dotnet.Watch\Watch.Aspire\Microsoft.DotNet.HotReload.Watch.Aspire.csprojDo debug the application host you can make it stop and wait for the debugger to attach on startup:
dotnet run --project src/AspireWatchDemo.Starter -- --wait-for-debugger apphostEdit:
src/AspireWatchDemo.Shared/SharedInfo.cs
Then refresh:
http://127.0.0.1:5071/http://127.0.0.1:5072/
Edit:
src/AspireWatchDemo.ApiService/Api.cs
Then refresh:
http://127.0.0.1:5071/