diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index ec804eb..9613476 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -20,7 +20,8 @@ export async function run() { const globalJsonPath = path.join(process.cwd(), 'global.json'); if (fs.existsSync(globalJsonPath)) { const globalJson = JSON.parse( - fs.readFileSync(globalJsonPath, {encoding: 'utf8'}) + // .trim() is necessary to strip BOM https://github.com/nodejs/node/issues/20649 + fs.readFileSync(globalJsonPath, {encoding: 'utf8'}).trim() ); if (globalJson.sdk && globalJson.sdk.version) { version = globalJson.sdk.version;