diff --git a/src/razor/src/razorLanguageServerOptionsResolver.ts b/src/razor/src/razorLanguageServerOptionsResolver.ts index 9804bbd9b..3b18aef3e 100644 --- a/src/razor/src/razorLanguageServerOptionsResolver.ts +++ b/src/razor/src/razorLanguageServerOptionsResolver.ts @@ -54,13 +54,14 @@ function findLanguageServerExecutable(withinDir: string) { } let pathWithExtension = `${fileName}${extension}`; - if (!fs.existsSync(pathWithExtension)) { + let fullPath = path.join(withinDir, pathWithExtension); + + if (!fs.existsSync(fullPath)) { // We might be running a platform neutral vsix which has no executable, instead we run the dll directly. pathWithExtension = `${fileName}.dll`; + fullPath = path.join(withinDir, pathWithExtension); } - const fullPath = path.join(withinDir, pathWithExtension); - if (!fs.existsSync(fullPath)) { throw new Error( vscode.l10n.t("Could not find Razor Language Server executable '{0}' within directory", fullPath)