From ff496ca580a101a6c4565e9a8fd3a513cd7f6313 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Tue, 20 Feb 2018 15:03:37 -0800 Subject: [PATCH] Fix absolute paths to dotnet (#597) --- src/CommonLib/hostfxr_utility.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/CommonLib/hostfxr_utility.cpp b/src/CommonLib/hostfxr_utility.cpp index ab75a8a296..2331d11f64 100644 --- a/src/CommonLib/hostfxr_utility.cpp +++ b/src/CommonLib/hostfxr_utility.cpp @@ -188,15 +188,19 @@ HOSTFXR_UTILITY::GetHostFxrParameters( { // Check if hostfxr is in this folder, if it is, we are a standalone application, // else we assume we received an absolute path to dotnet.exe - hr = GetStandaloneHostfxrParameters( - struExeLocation.QueryStr(), - pcwzApplicationPhysicalPath, - pcwzArguments, - hEventLog, - struHostFxrDllLocation, - pdwArgCount, - ppwzArgv); - goto Finished; + if (!struExeLocation.EndsWith(L"dotnet.exe") && + !struExeLocation.EndsWith(L"dotnet")) + { + hr = GetStandaloneHostfxrParameters( + struExeLocation.QueryStr(), + pcwzApplicationPhysicalPath, + pcwzArguments, + hEventLog, + struHostFxrDllLocation, + pdwArgCount, + ppwzArgv); + goto Finished; + } } else {