diff --git a/src/AspNetCoreModuleV2/CommonLib/hostfxr_utility.cpp b/src/AspNetCoreModuleV2/CommonLib/hostfxr_utility.cpp index a41fd0d4cd..5746730507 100644 --- a/src/AspNetCoreModuleV2/CommonLib/hostfxr_utility.cpp +++ b/src/AspNetCoreModuleV2/CommonLib/hostfxr_utility.cpp @@ -497,13 +497,8 @@ HOSTFXR_UTILITY::InvokeWhereToFindDotnet() hProcess = processInformation.hProcess; hThread = processInformation.hThread; - // Wait for where.exe to return, waiting 2 seconds. - if (LOG_LAST_ERROR_IF(WaitForSingleObject(processInformation.hProcess, 2000) != WAIT_OBJECT_0)) - { - // Timeout occured, terminate the where.exe process and return. - FINISHED_LAST_ERROR_IF(!TerminateProcess(processInformation.hProcess, 2)); - FINISHED_IF_FAILED(HRESULT_FROM_WIN32(ERROR_TIMEOUT)); - } + // Wait for where.exe to return + WaitForSingleObject(processInformation.hProcess, INFINITE); // // where.exe will return 0 on success, 1 if the file is not found