diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 757d5b9ea46..578d8deb9f7 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -340,8 +340,8 @@ function MSBuild { # Work around issues with Azure Artifacts credential provider # https://github.com/dotnet/arcade/issues/3932 - if [[ "$ci" == true ]]; then - dotnet nuget locals http-cache -c + if [[ "$ci" == true && `which dotnet` ]]; then + dotnet nuget locals http-cache -c fi local toolset_dir="${_InitializeToolset%/*}"