Skip to content

Commit ec746f5

Browse files
committed
fix linting bug
1 parent b8bbbab commit ec746f5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/razor/src/extension.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
65
import * as vscode from 'vscode';
76
import * as vscodeapi from 'vscode';
87
import { ExtensionContext } from 'vscode';
@@ -50,6 +49,7 @@ import { PlatformInformation } from '../../shared/platform';
5049
import { RazorLanguageServerOptions } from './razorLanguageServerOptions';
5150
import { resolveRazorLanguageServerOptions } from './razorLanguageServerOptionsResolver';
5251
import { RazorFormatNewFileHandler } from './formatNewFile/razorFormatNewFileHandler';
52+
import * as path from "path";
5353

5454
// We specifically need to take a reference to a particular instance of the vscode namespace,
5555
// otherwise providers attempt to operate on the null extension.
@@ -86,6 +86,15 @@ export async function activate(
8686
);
8787

8888
const dotnetInfo = await hostExecutableResolver.getHostExecutableInfo();
89+
const dotnetRuntimePath = path.dirname(dotnetInfo.path);
90+
91+
// Take care to always run .NET processes on the runtime that we intend.
92+
// The dotnet.exe we point to should not go looking for other runtimes.
93+
const env: NodeJS.ProcessEnv = { ...process.env };
94+
env.DOTNET_ROOT = dotnetRuntimePath;
95+
env.DOTNET_MULTILEVEL_LOOKUP = '0';
96+
// Save user's DOTNET_ROOT env-var value so server can recover the user setting when needed
97+
env.DOTNET_ROOT_USER = process.env.DOTNET_ROOT ?? 'EMPTY';
8998

9099
// Set up DevKit environment for telemetry
91100
if (csharpDevkitExtension) {

0 commit comments

Comments
 (0)