()
| 10 | let _msbuildVersion: string | undefined; |
| 11 | |
| 12 | export async function getMSBuildVersion(): Promise<string | undefined> { |
| 13 | if (_msbuildVersion !== undefined) { |
| 14 | return _msbuildVersion; |
| 15 | } |
| 16 | |
| 17 | const msbuildExeName = join('msbuild', CoreClrDebugUtil.getPlatformExeExtension()); |
| 18 | |
| 19 | try { |
| 20 | const data = await execChildProcess(`${msbuildExeName} -version -nologo`, process.cwd(), process.env); |
| 21 | const match = /^(\d+\.\d+\.\d+\.\d+)$/.exec(data); |
| 22 | if (match) { |
| 23 | _msbuildVersion = match[1]; |
| 24 | } |
| 25 | } catch { |
| 26 | /* empty */ |
| 27 | } |
| 28 | |
| 29 | return _msbuildVersion; |
| 30 | } |
no test coverage detected