diff --git a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp index 0d5ce7670a..4a3fd9901d 100644 --- a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp +++ b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp @@ -243,7 +243,13 @@ IN_PROCESS_APPLICATION::Recycle( // Try to graceful shutdown the managed application // and call exit to terminate current process ShutDown(); - exit(0); + + // If we set a static callback, we don't want to kill the current process as + // that will kill the test process and means we are running in hostable webcore mode. + if (s_fMainCallback == NULL) + { + exit(0); + } } }