dotnet / dotnet/sdk

dotnetup crashes with malformed global.json in the current directory

Open
#54,961 0 comments 1 reaction 2 assignees Claimed by @nagilson View on GitHub
Area-dotnetup untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Discussed in https://github.com/dotnet/sdk/discussions/54839

Originally posted by **jjonescz** June 18, 2026
Create global.json like the following:

```jsonc
{
"sdk": {
// "version": "10.0.100"
}
}
```

Run `dotnetup` on WSL.
Observe:

```sh
Error: '/' is invalid after a value. Expected either ',', '}', or ']'. Path: $.sdk | LineNumber: 2 | BytePositionInLine: 8.
```

Not a very clear error, took me a while to figure out what's wrong.

`dotnet` itself can handle such `global.json` btw. But even if it was completely malformed, I'm not sure why `dotnetup` should be reading `global.json` from the current directory in the first place.

dotnetup reads global jsons when doing installs/etc - but if the dotnetup command doesn't use the global.json we shouldn't be parsing it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.