Skip to content

[Hot Reload][Unstable] There is an error "Exited with error code -1073741510" when pressing Ctrl+C to exit dotnet-watch after installing 10.0 RC2 SDK #64001

@jinzhao1127

Description

@jinzhao1127

REGRESSION INFO : Works with .NET SDK version 9.0.303 and .NET10.0 Preview 6 but fails after .NET SDK 10.0 Preview 7

INSTALL STEPS

  1. Install .NET SDK version 10.0 RC 2 SDK
  2. Apply feed

Platform

  • Windows
  • macOS
  • Linux

Repro Steps

  1. Open up a normal Command Prompt (Terminal)
  2. Create a MVC app, and run it using dotnet watch
    dotnet new mvc -o MyMVCApp
    cd MyMVCApp
    dotnet watch
    
  3. The project will automatically open in browser.
  4. Back to the Command Prompt and click Ctrl + C to exit dotnet-watch

Actual Result
There is an error when pressing Ctrl+C to exit dotnet-watch

Image

Expected Result
It should not any error after type Ctrl+C . For example, below is what I see when using .NET 10.0 Preview 6

Image

Error Log

[MyMVCApp (net10.0)] Exited with error code -1073741510

C:\Users\v-zhajin\MyMVCApp>dotnet watch --verbose
dotnet watch ⌚ Working directory: 'C:\Users\v-zhajin\MyMVCApp'
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 🔨 Building C:\Users\v-zhajin\MyMVCApp\MyMVCApp.csproj ...
dotnet watch 🚀 Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'build C:\Users\v-zhajin\MyMVCApp\MyMVCApp.csproj -consoleLoggerParameters:NoSummary;Verbosity=minimal --property:NuGetInteractive=true': process id 5800
dotnet watch ⌚ Process id 5800 ran for 2055ms and exited with exit code 0.
dotnet watch 🔨 Build succeeded: C:\Users\v-zhajin\MyMVCApp\MyMVCApp.csproj
dotnet watch 🔨   Determining projects to restore...
dotnet watch 🔨   All projects are up-to-date for restore.
dotnet watch 🔨 C:\Program Files\dotnet\sdk\10.0.100-rc.2.xxxxxx\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(351,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\Users\v-zhajin\MyMVCApp\MyMVCApp.csproj]
dotnet watch 🔨   MyMVCApp -> C:\Users\v-zhajin\MyMVCApp\bin\Debug\net10.0\MyMVCApp.dll
dotnet watch 🔨
dotnet watch 🔨 Build succeeded.
dotnet watch 🔨     0 Warning(s)
dotnet watch 🔨     0 Error(s)
dotnet watch 🔨
dotnet watch 🔨 Time Elapsed 00:00:01.70
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\/**;**/*.user;**/*.*proj;**/*.sln;**/*.slnx;**/*.vssscc;**/.DS_Store' under project 'C:\Users\v-zhajin\MyMVCApp'
dotnet watch ⌚ Application kind: WebApplication.
dotnet watch 🔃 [MyMVCApp (net10.0)] Using browser-refresh middleware
dotnet watch 🔃 [MyMVCApp (net10.0)] Refresh server running at wss://localhost:54160,ws://localhost:54161.
dotnet watch ⌚ dotnet-watch is configured to launch a browser on ASP.NET Core application startup.
dotnet watch 🔥 [MyMVCApp (net10.0)] Waiting for application to connect to pipe b7294e9eab384fc88c3748ceca440c01.
dotnet watch 🚀 [MyMVCApp (net10.0)] Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'run --no-build -e DOTNET_WATCH=1 -e DOTNET_WATCH_ITERATION=1 -e "HOTRELOAD_DELTA_CLIENT_LOG_MESSAGES=dotnet watch 🕵️ [MyMVCApp (net10.0)]" -e DOTNET_MODIFIABLE_ASSEMBLIES=debug -e "DOTNET_STARTUP_HOOKS=C:\Program Files\dotnet\sdk\10.0.100-rc.2.xxxxx\DotnetTools\dotnet-watch\10.0.100-rc.2.25502.107\tools\net10.0\any\hotreload\net6.0\Microsoft.AspNetCore.Watch.BrowserRefresh.dll;C:\Program Files\dotnet\sdk\10.0.100-rc.xxxxxx\DotnetTools\dotnet-watch\10.0.100-rc.2.25502.107\tools\net10.0\any\hotreload\net10.0\Microsoft.Extensions.DotNetDeltaApplier.dll" -e DOTNET_WATCH_HOTRELOAD_NAMEDPIPE_NAME=b7294e9eab384fc88c3748ceca440c01 -e ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT=wss://localhost:54160,ws://localhost:54161 -e ASPNETCORE_AUTO_RELOAD_WS_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvMYVA6oVY2+3JZJu6y7rwGv/HJkQDWwocwzB1Q2mbnbp4ol8tbAmc9IE5vrDBWbcMeml3iCCrJEM077FQT9ZSc0aW36725L/YPwTBVtt2VNAmLf2ArpYiP1q9KkofL2Xyu17OYhqz1w6O01jiOf4frs67mPIGAc4D+cnsmPv6NVGTGczf5LTHfFHfUp4oPf9odqm+BN9RGWowUiUKbf6e+10AszWg1hF9tOVtIXBQgnvACrLEzdmIM3PRn7H9M1Y1ARtOIGCj/UlaEm7EYo1qtgWghK/BKXxrbnjhyL3wcIH6+R6rGKHBFeZN2oSM+NyNw7WjLgcYJ9wLseY9kw54QIDAQAB -e ASPNETCORE_AUTO_RELOAD_VDIR=/ -e ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.AspNetCore.Watch.BrowserRefresh -e Logging__LogLevel__Microsoft.AspNetCore.Watch=Debug': process id 11948
Using launch settings from C:\Users\v-zhajin\MyMVCApp\Properties\launchSettings.json...
dotnet watch 🕵️ [MyMVCApp (net10.0)] Loaded into process: C:\Users\v-zhajin\MyMVCApp\bin\Debug\net10.0\MyMVCApp.dll (C:\Program Files\dotnet\sdk\10.0.100-rc.2.25502.107\DotnetTools\dotnet-watch\10.0.100-rc.2.25502.107\tools\net10.0\any\hotreload\net10.0\Microsoft.Extensions.DotNetDeltaApplier.dll)
dotnet watch 🕵️ [MyMVCApp (net10.0)] Windows Ctrl+C handling enabled.
dotnet watch 🕵️ [MyMVCApp (net10.0)] Connecting to hot-reload server via pipe b7294e9eab384fc88c3748ceca440c01
dotnet watch 🕵️ [MyMVCApp (net10.0)] Connected.
dotnet watch 🔥 [MyMVCApp (net10.0)] Capabilities: 'Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType AddFieldRva'.
dbug: Microsoft.AspNetCore.Watch.BrowserRefresh.BlazorWasmHotReloadMiddleware[0]
      Middleware loaded
dbug: Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserScriptMiddleware[0]
      Middleware loaded. Script /_framework/aspnetcore-browser-refresh.js (16481 B).
dbug: Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserScriptMiddleware[0]
      Middleware loaded. Script /_framework/blazor-hotreload.js (799 B).
dbug: Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware[0]
      Middleware loaded: DOTNET_MODIFIABLE_ASSEMBLIES=debug, __ASPNETCORE_BROWSER_TOOLS=true
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5095
dotnet watch ⌚ Launching browser: http://localhost:5095
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\MyMVCApp
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
      Failed to determine the https port for redirect.
dbug: Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware[1]
      Response markup is scheduled to include browser refresh script injection.
dbug: Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware[2]
      Response markup was updated to include browser refresh script injection.
dbug: Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserScriptMiddleware[0]
      Script injected: /_framework/aspnetcore-browser-refresh.js
dotnet watch 🌐 [Browser #1] Connected to referesh server.
dotnet watch ⌚ Solution: (null)
dotnet watch ⌚   Project: C:\Users\v-zhajin\MyMVCApp\MyMVCApp.csproj
dotnet watch ⌚     Document: C:\Users\v-zhajin\MyMVCApp\Controllers\HomeController.cs [cbNhhy49fnKPz2Xt1wbcjaceO9TGTqS4bacr2ENjHXk=]
dotnet watch ⌚     Document: C:\Users\v-zhajin\MyMVCApp\Models\ErrorViewModel.cs [5kBRPf6SZ4wmQECWYBrNg1jp8pn1h/10AdaDthFkWM8=]
dotnet watch ⌚     Document: C:\Users\v-zhajin\MyMVCApp\Program.cs [BT0x8ipuiefCHwl670rdwZzOlkEuB171tCD1xAZIUFc=]
dotnet watch ⌚     Document: C:\Users\v-zhajin\MyMVCApp\obj\Debug\net10.0\MyMVCApp.GlobalUsings.g.cs [3N9VcC4C88yI78mo7CtogYkfiCHfJ9uQFXuklq6YE6E=]
dotnet watch ⌚     Document: C:\Users\v-zhajin\MyMVCApp\obj\Debug\net10.0\.NETCoreApp,Version=v10.0.AssemblyAttributes.cs [k9Z0dhluv8gNHX2IRLkRRs/WeNEF9c5jXrkAykBhDJs=]
dotnet watch ⌚     Document: C:\Users\v-zhajin\MyMVCApp\obj\Debug\net10.0\MyMVCApp.AssemblyInfo.cs [KdsAea+FCIURQS/4SNsRcja6qBW3P/07OF6eGMvNYBI=]
dotnet watch ⌚     Document: C:\Users\v-zhajin\MyMVCApp\obj\Debug\net10.0\MyMVCApp.RazorAssemblyInfo.cs [Hex2YP0gPZXiOAvVxPUq7VMFkq6ZaOVK1cgOb3OO558=]
dotnet watch ⌚     Additional: C:\Users\v-zhajin\MyMVCApp\Views\Home\Index.cshtml [DJ5gZvf//1crh8QUxgB44bM0WXMHZub/klxqGcl1Epo=]
dotnet watch ⌚     Additional: C:\Users\v-zhajin\MyMVCApp\Views\Home\Privacy.cshtml [DgCkRFshSGPqUciYX64ZcLQ+kycSIW+gR/rzBiuyNEU=]
dotnet watch ⌚     Additional: C:\Users\v-zhajin\MyMVCApp\Views\Shared\Error.cshtml [Xb+Ytrk5SteCBu3OQMqx16I4qmnP76Qbqw68aqIkiKo=]
dotnet watch ⌚     Additional: C:\Users\v-zhajin\MyMVCApp\Views\Shared\_ValidationScriptsPartial.cshtml [V08x9amkPNcvTgvBmf/9snIEsNC1N6yc1frUnYID39U=]
dotnet watch ⌚     Additional: C:\Users\v-zhajin\MyMVCApp\Views\_ViewImports.cshtml [XmlwHpTiW3CgBkR8PHkB2yzPg9+FlnvhRzp6xe+C1jE=]
dotnet watch ⌚     Additional: C:\Users\v-zhajin\MyMVCApp\Views\_ViewStart.cshtml [R+ArTaINGYiSt7GwCxKUQGh5fEOO8ugtIP9wtNVrrTk=]
dotnet watch ⌚     Additional: C:\Users\v-zhajin\MyMVCApp\Views\Shared\_Layout.cshtml [bFmhW5mufcUfU3Y6JfGqLsnzjuchAbkVGMAOT/TPtbU=]
dotnet watch ⌚     Config: C:\Users\v-zhajin\MyMVCApp\obj\Debug\net10.0\MyMVCApp.GeneratedMSBuildEditorConfig.editorconfig [6bK1fObgFGqxmfnhr2KujFgHh7Y/9jcHYmq2ZGRut44=]
dotnet watch ⌚     Config: C:\Program Files\dotnet\sdk\10.0.100-rc.2.xxxxxxx\Sdks\Microsoft.NET.Sdk\analyzers\build\config\analysislevel_10_default.globalconfig [aIiuubiOOvHYkJihTt3jPfP1yoxKT4gNLyJ5qlYKST8=]
dotnet watch 🔥 Hot reload session started.
dotnet watch ⌚ Waiting for changes
info: Microsoft.Hosting.Lifetime[0]
dotnet watch 🛑 Shutdown requested. Press Ctrl+C again to force exit.
      Application is shutting down...
dotnet watch ⌚ Disposing remaining child processes.
dotnet watch ⌚ [MyMVCApp (net10.0)] Terminating process 11948 (Ctrl+C).
dotnet watch ⌚ [MyMVCApp (net10.0)] Waiting for process 11948 to exit within 5s.
dotnet watch ⌚ [MyMVCApp (net10.0)] Process id 11948 ran for 6340ms and exited with exit code -1073741510.
dotnet watch ❌ [MyMVCApp (net10.0)] Exited with error code -1073741510
dotnet watch 🔥 [MyMVCApp (net10.0)] Disposing agent communication pipe
dotnet watch 🌐 [Browser #1] Disconnected.

NOTES​:

  1. This issue also repro on 9.0/8.0 projects after installing 10.0 RC 2 SDK.
  2. This issue does note repro on 9.0/8.0 projects without 10.0 RC 2 install.
  3. This issue does not repro on 10.0 Preview 6 project.
  4. This issue also repro on Blazor Web App and Blazor WASM Standalone App.
  5. For windows: 3 of 10 times, for MacOs: 8 of 10 times

Metadata

Metadata

Assignees

No one assigned

    Labels

    NativeAOTarea-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions