diff --git a/lib/installer.js b/lib/installer.js index 5cf9a83..75891d6 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -163,6 +163,7 @@ 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 7016be9..7c975fd 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -171,6 +171,10 @@ export class DotnetCoreInstaller { this.version, 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; }