{"record":{"id":"e05184d9dd9ed304","repo":"microsoft/vscode","slug":"failed-to-check-for-net-version-using-this-dot","errorCode":null,"errorMessage":"Failed to check for .NET version using '${this.dotnet.command} --version'.","messagePattern":"Failed to check for \\.NET version using '(.+?) --version'\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/mcp/vscode-node/nuget.ts","lineNumber":167,"sourceCode":"\t\t} finally {\n\t\t\ttry {\n\t\t\t\tawait fs.rm(installDir, { recursive: true, force: true });\n\t\t\t} catch (e) {\n\t\t\t\tthis.logService.warn(`Failed to clean up temporary .NET tool install directory ${installDir}.\nError: ${e}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync getDotnetVersion(cwd: string): Promise<string> {\n\t\tconst args = this.dotnet.args.concat(['--version']);\n\t\tconst result = await this.commandExecutor.executeWithTimeout(this.dotnet.command, args, cwd);\n\t\tconst version = result.stdout.trim();\n\t\tif (result.exitCode !== 0 || !version) {\n\t\t\tthis.logService.warn(`Failed to check for .NET version while checking if a NuGet MCP server exists.\nstdout: ${result.stdout}\nstderr: ${result.stderr}`);\n\t\t\tthrow new Error(`Failed to check for .NET version using '${this.dotnet.command} --version'.`);\n\t\t}\n\n\t\treturn version;\n\t}\n\n\tasync getLatestPackageVersion(cwd: string, id: string): Promise<{ id: string; version: string; owners?: string } | undefined> {\n\t\t// we don't use --exact-match here because it does not return owner information on NuGet.org\n\t\tconst args = this.dotnet.args.concat(['package', 'search', id, '--source', this.source, '--prerelease', '--format', 'json']);\n\t\tconst searchResult = await this.commandExecutor.executeWithTimeout(this.dotnet.command, args, cwd);\n\t\tconst searchData: DotnetPackageSearchOutput = JSON.parse(searchResult.stdout.trim());\n\t\tfor (const result of searchData.searchResult ?? []) {\n\t\t\tfor (const pkg of result.packages ?? []) {\n\t\t\t\tif (pkg.id.toUpperCase() === id.toUpperCase()) {\n\t\t\t\t\treturn { id: pkg.id, version: pkg.latestVersion, owners: pkg.owners };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/mcp/vscode-node/nuget.ts#L149-L185","documentation":"Error \"Failed to check for .NET version using '${this.dotnet.command} --version'.\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/mcp/vscode-node/nuget.ts:167 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}