Skip to content

Commit 291af1a

Browse files
committed
add option to specify path to .Net Runtime, fixes #7
1 parent 4e12793 commit 291af1a

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
"type": "boolean",
4444
"default": false,
4545
"description": "If true, the log file will overwrite previous log files of the same name if they exist, default is false."
46+
},
47+
"ooxml.dotNetPath": {
48+
"type": "string",
49+
"description": "The absolute path to the .Net Runtime"
4650
}
4751
}
4852
},
@@ -128,4 +132,4 @@
128132
"dependencies": {
129133
"csv-writer": "^1.6.0"
130134
}
131-
}
135+
}

src/ooxml-validator.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,17 @@ export default class OOXMLValidator {
340340
await commands.executeCommand('dotnet.showAcquisitionLog');
341341

342342
const requestingExtensionId = 'mikeebowen.ooxml-validator-vscode';
343-
const commandRes = await commands.executeCommand<IDotnetAcquireResult>('dotnet.acquire', {
344-
version: '3.1',
345-
requestingExtensionId,
346-
});
347-
const dotnetPath = commandRes!.dotnetPath;
343+
let dotnetPath: string | undefined = workspace.getConfiguration('ooxml').get('dotNetPath');
344+
348345
if (!dotnetPath) {
349-
throw new Error('Could not resolve the dotnet path!');
346+
const commandRes = await commands.executeCommand<IDotnetAcquireResult>('dotnet.acquire', {
347+
version: '3.1',
348+
requestingExtensionId,
349+
});
350+
dotnetPath = commandRes!.dotnetPath;
351+
if (!dotnetPath) {
352+
throw new Error('Could not resolve the dotnet path!');
353+
}
350354
}
351355

352356
const ooxmlValidateExtension = extensions.getExtension(requestingExtensionId);

0 commit comments

Comments
 (0)