diff --git a/lib/installer.js b/lib/installer.js index 75891d6..41c3b2c 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -72,6 +72,8 @@ class DotnetCoreInstaller { else { console.log('Using cached tool'); } + // Need to set this so that .NET Core global tools find the right locations. + core.exportVariable('DOTNET_ROOT', toolPath); // Prepend the tools path. instructs the agent to prepend for future tasks core.addPath(toolPath); }); @@ -163,7 +165,6 @@ class DotnetCoreInstaller { // cache tool console.log('Caching tool'); let cachedDir = yield tc.cacheDir(extPath, this.cachedToolName, this.version, this.arch); - core.exportVariable('DOTNET_ROOT', cachedDir); console.log('Successfully installed', this.version); return cachedDir; }); diff --git a/src/installer.ts b/src/installer.ts index 7c975fd..1979227 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -58,6 +58,9 @@ export class DotnetCoreInstaller { console.log('Using cached tool'); } + // Need to set this so that .NET Core global tools find the right locations. + core.exportVariable('DOTNET_ROOT', toolPath); + // Prepend the tools path. instructs the agent to prepend for future tasks core.addPath(toolPath); } @@ -172,9 +175,6 @@ export class DotnetCoreInstaller { this.arch ); - // Need to set this so that .NET Core global tools find the right locations. - core.exportVariable('DOTNET_ROOT', cachedDir); - console.log('Successfully installed', this.version); return cachedDir; }