REGRESSION INFO: Works well on 11.0 Preview 3
INSTALL STEPS:
- Clean Win 11 25h2 x64
- Install Latest 11.0 P4 daily build
- Apply Feed
Platform
Repro Steps
- Open up a normal Command Prompt (Terminal)
- Create a mvc app and run it.
dotnet new mvc -o MVC
cd MVC
dotnet watch
- The project will automatically open in browser.
- Back to the Command Prompt and click Ctrl + C to exit dotnet-watch
Actual Result
There is an error " Exited with error code -1"when pressing Ctrl+C to exit dotnet-watch
Error Log
dotnet watch ❌ [MVC1 (net11.0)] Exited with error code -1
C:\Users\v-zhajin\MVC1>dotnet watch --verbose
dotnet watch ⌚ Working directory: 'C:\Users\v-zhajin\MVC1'
dotnet watch ⌚ Watching with Hot Reload.
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 🔨 Restoring C:\Users\v-zhajin\MVC1\MVC1.csproj ...
dotnet watch 🚀 Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'restore C:\Users\v-zhajin\MVC1\MVC1.csproj --property:NuGetInteractive=true -consoleLoggerParameters:NoSummary': process id 9432
Restore complete (0.5s)
Build succeeded in 1.1s
dotnet watch ⌚ Process id 9432 ran for 6048ms and exited with exit code 0.
dotnet watch 🔨 Project graph loaded in 0.6s.
dotnet watch 🔨 Building C:\Users\v-zhajin\MVC1\MVC1.csproj ...
dotnet watch 🚀 Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'build C:\Users\v-zhajin\MVC1\MVC1.csproj --property:NuGetInteractive=true --framework net11.0 --no-restore': process id 18888
info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
MVC1 net11.0 succeeded (0.8s) → bin\Debug\net11.0\MVC1.dll
Build succeeded in 1.5s
dotnet watch ⌚ Process id 18888 ran for 6368ms and exited with exit code 0.
dotnet watch ⌚ Loading projects ...
dotnet watch 🔨 Design-time build completed in 0.7s.
dotnet watch ⌚ Loaded 1 project(s) in 0.7s.
dotnet watch 🔨 Reading static web assets manifest file: 'C:\Users\v-zhajin\MVC1\obj\Debug\net11.0\staticwebassets.development.json'.
dotnet watch ⌚ Watching 78 file(s) for changes
dotnet watch ⌚ Exclusion glob: '**\node_modules\**;node_modules\**;**\jspm_packages\**;jspm_packages\**;**\bower_components\**;bower_components\**;**\packages.lock.json;bin\Debug\/**;obj\Debug\/**;bin\/**;obj\/**;bin\Debug\net11.0\publish\/**;**/*.user;**/*.*proj;**/*.sln;**/*.slnx;**/*.vssscc;**/.DS_Store' under project 'C:\Users\v-zhajin\MVC1'
dotnet watch ⌚ Solution after project update: v1
dotnet watch 🔥 Hot reload session started.
dotnet watch ⌚ Application kind: WebApplication.
dotnet watch 🔃 [MVC1 (net11.0)] Using browser-refresh middleware
dotnet watch 🔃 [MVC1 (net11.0)] Refresh server running at ws://localhost:49822,wss://localhost:49823.
dotnet watch ⌚ dotnet-watch is configured to launch a browser on ASP.NET Core application startup.
dotnet watch 🔥 [MVC1 (net11.0)] Waiting for application to connect to pipe 'bf31c18dad1846eca54f4089b774cf91'.
dotnet watch 🚀 [MVC1 (net11.0)] Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'run --no-build --framework net11.0 -e DOTNET_WATCH=1 -e DOTNET_WATCH_ITERATION=1 -e DOTNET_MODIFIABLE_ASSEMBLIES=debug -e "DOTNET_STARTUP_HOOKS=C:\Program Files\dotnet\sdk\11.0.100-preview.4.26223.112\DotnetTools\dotnet-watch\11.0.100-preview.4.26223.112\tools\net11.0\any\hotreload\net6.0\Microsoft.AspNetCore.Watch.BrowserRefresh.dll;C:\Program Files\dotnet\sdk\11.0.100-preview.4.26223.112\DotnetTools\dotnet-watch\11.0.100-preview.4.26223.112\tools\net11.0\any\hotreload\net10.0\Microsoft.Extensions.DotNetDeltaApplier.dll" -e DOTNET_WATCH_HOTRELOAD_NAMEDPIPE_NAME=bf31c18dad1846eca54f4089b774cf91 -e ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT=ws://localhost:49822,wss://localhost:49823 -e ASPNETCORE_AUTO_RELOAD_WS_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv5QaVAcj4dF7c7wHV7wvb4cakuGj5x+lfAd2jyE2Uc9jlARO/i7e/1j8QzBM+mn0CebMBybcZt2ztka3GBgmdyEb8TU3qc6hWQaxETXCo3ovk9k/uMDZq5XUhh5jGVVSjS6m8WmeGAMEcUgil4DYYkDhis5oboYR3bK8vubCrZ1dmh7J/2uXCuYxra2oFW0ewXiAsDA/K2yKZlEKvuA2Ec6WNmPoOYgpKa4eq9QbBC0QS+vnVkS0Opq8lAoB+9AoKqAPUwzttURlwiKOxcKb9Z9MmhZ7XxLWqsygOA2OpWdSpw743FGxkht6XdF1CQH4GINvIjXHkSUu80O7G11piQIDAQAB -e ASPNETCORE_AUTO_RELOAD_VDIR=/ -e ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.AspNetCore.Watch.BrowserRefresh': process id 20252
Using launch settings from C:\Users\v-zhajin\MVC1\Properties\launchSettings.json...
dotnet watch 🔥 [MVC1 (net11.0)] Capabilities: 'Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType AddFieldRva AddExplicitInterfaceImplementation'.
dotnet watch ⌚ Waiting for changes
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5097
dotnet watch ⌚ Launching browser: http://localhost:5097
dotnet watch 🚀 Launched 'http://localhost:5097' with arguments '': process id 11256
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: C:\Users\v-zhajin\MVC1
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the https port for redirect.
dotnet watch 🌐 [Browser #1] Connected to refresh server.
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down...
dotnet watch 🛑 Shutdown requested. Press Ctrl+C again to force exit.
dotnet watch ⌚ Terminating remaining child processes.
dotnet watch ⌚ [MVC1 (net11.0)] Terminating process 20252 (Ctrl+C).
dotnet watch ⌚ [MVC1 (net11.0)] Waiting for process 20252 to exit within 5s.
dotnet watch ⌚ [MVC1 (net11.0)] Terminating process 20252 (Kill).
dotnet watch ⌚ [MVC1 (net11.0)] Process id 20252 ran for 36982ms and exited with exit code -1.
dotnet watch ❌ [MVC1 (net11.0)] Exited with error code -1
dotnet watch 🔥 [MVC1 (net11.0)] Disposing agent communication pipe
dotnet watch 🌐 [Browser #1] Disconnected.
Expected Result
It should not any error after type Ctrl+C

Note:
- This issue also reproduces on 11.0 razor/blazor/webapi app
- This issue also reproduces on 10.0/9.0/8.0 after installing 11.0 P4
REGRESSION INFO: Works well on 11.0 Preview 3
INSTALL STEPS:
Platform
Repro Steps
Actual Result
There is an error " Exited with error code -1"when pressing Ctrl+C to exit dotnet-watch
Error Log
dotnet watch ❌ [MVC1 (net11.0)] Exited with error code -1Expected Result

It should not any error after type Ctrl+C
Note: