Hotreload occasionally hangs app startup
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
Occasionally when launching an ASP.NET Core application from Visual Studio w/o debugger attached the terminal will open and hang and the application will never actually start.
Attaching a debugger to the process and seeing where it's stuck shows Microsoft_Extensions_DotNetDeltaApplier!Microsoft.DotNet.HotReload.PipeListener.Listen blocking forever.
Full stack
```
00 000000b0`c2d7da08 00007ffd`f9792533 ntdll!NtWaitForMultipleObjects+0x14
01 000000b0`c2d7da10 00007ffc`50bcb8aa KERNELBASE!WaitForMultipleObjectsEx+0x123
02 000000b0`c2d7dd00 00007ffc`50bca842 System_Private_CoreLib!System.Threading.WaitHandle.WaitForMultipleObjectsIgnoringSyncContext+0x15a [_/src/runtime/src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.Windows.cs @ 72]
03 000000b0`c2d7ddf0 00007ffc`50bb84c4 System_Private_CoreLib!System.Threading.WaitHandle.WaitOneNoCheck+0x1e2 [_/src/runtime/src/libraries/System.Private.CoreLib/src/System/Threading/WaitHandle.cs @ 181]
04 000000b0`c2d7df00 00007ffc`50bbcf70 System_Private_CoreLib!System.Threading.Condition.Wait+0xf4 [_/src/runtime/src/libraries/System.Private.CoreLib/src/System/Threading/Condition.cs @ 115]
05 000000b0`c2d7df80 00007ffc`50bd9ca2 System_Private_CoreLib!System.Threading.ManualResetEventSlim.Wait+0x270 [_/src/runtime/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs @ 580]
06 000000b0`c2d7e030 00007ffc`50bd9a08 System_Private_CoreLib!System.Threading.Tasks.Task.SpinThenBlockingWait+0xe2 [_/src/runtime/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @ 3169]
07 000000b0`c2d7e0a0 00007ffc`50bd9946 System_Private_CoreLib!System.Threading.Tasks.Task.InternalWaitCore+0xb8
08 000000b0`c2d7e120 00007ffc`50c39c85 System_Private_CoreLib!System.Threading.Tasks.Task.InternalWait+0x26
09 000000b0`c2d7e150 00007ffc`8d915cf6 System_Private_CoreLib!System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification+0x25 [_/src/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/TaskAwaiter.cs @ 111]
0a 000000b0`c2d7e190 00007ffc`8d913e1e Microsoft_Extensions_DotNetDeltaApplier!Microsoft.DotNet.HotReload.PipeListener.Listen+0x186
0b 000000b0`c2d7e290 00007ffc`ed4d54e3 Microsoft_Extensions_DotNetDeltaApplier!StartupHook.Initialize+0x38e
```
DumpAsync stack
```
00000241704b3c38 00007ffc8dbb3ff0 ( ) System.Threading.Tasks.ValueTask+ValueTaskSourceAsTask
00000241704b3ce0 00007ffc8dbb50b0 (0) Microsoft.DotNet.HotReload.StreamExtesions+d__16 @ 7ffc8d91ba50
00000241704b3db8 00007ffc8dbb7980 (0) Microsoft.DotNet.HotReload.StreamExtesions+d__9 @ 7ffc8d91b620
00000241704bc900 00007ffc8dbbdb50 (0) Microsoft.DotNet.HotReload.PipeListener+d__9 @ 7ffc8d91ae80
00000241704af5a0 00007ffc8db88ba8 (1) Microsoft.DotNet.HotReload.PipeListener+d__8 @ 7ffc8d9168f0
00000241704af640 00007ffc8db89880 () System.Threading.Tasks.Task+SetOnInvokeMres
```
### To Reproduce
Ctrl-F5 an app in VS over and over until it fails to hit `Main`.
### Exceptions (if any)
### Further technical details
VS Insiders [11519.219]
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.