Skip to content

Commit 17483ab

Browse files
Check program files for AF core tools (#248)
1 parent 2313e31 commit 17483ab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/Integration/IntegrationTestBase.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,17 @@ private static string GetFunctionsCoreToolsPath()
227227

228228
if (!File.Exists(funcPath))
229229
{
230-
throw new FileNotFoundException("Azure Function Core Tools not found at " + funcPath);
230+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
231+
{
232+
// Search Program Files folder as well
233+
string programFilesFuncPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Microsoft", "Azure Functions Core Tools", funcExe);
234+
if (File.Exists(programFilesFuncPath))
235+
{
236+
return programFilesFuncPath;
237+
}
238+
throw new FileNotFoundException($"Azure Function Core Tools not found at {funcPath} or {programFilesFuncPath}");
239+
}
240+
throw new FileNotFoundException($"Azure Function Core Tools not found at {funcPath}");
231241
}
232242

233243
return funcPath;

0 commit comments

Comments
 (0)