question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet muxer reports JSON syntax error when global.json is saved in UTF8+BOM

See original GitHub issue

Steps to reproduce

  1. Save global.json in utf8 with byte order mark.
  2. dotnet build

Expected behavior

dotnet build shows no errors

Actual behavior

A JSON parsing exception occurred: * Line 1, Column 2 Syntax error: Malformed token

Environment data

dotnet --version output:

A JSON parsing exception occurred: * Line 1, Column 2 Syntax error: Malformed token
1.0.0-beta-002171

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:28 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
gkhanna79commented, Jun 17, 2016

This can be looked into fixing for future update - UTF8 is what we support (or lack of BOM). This can be called out in Release notes.

For UTF16 issue fix in a future update, please file a new issue and assign to @schellap

0reactions
naamundscommented, Jun 17, 2016

@gkhanna79 I just ran into this issue with a global.json that has a UTF-16 BOM.

I’m testing .NET on a Windows Nano Server container, so I used PowerShell’s Out-File cmdlet to create the global.json file, which appears to use UTF-16 by default.

I was able to work around the issue by removing the BOM by using [IO.File]::WriteAllText. I also verified that using a UTF-8 BOM is another workaround, e.g. by using Out-File -Encoding utf8.

I’m wondering if it would be worth fixing this issue for UTF-16 in addition to UTF-8, because I think people might run into it, especially because the error message does not make it obvious what the problem is.

cc: @dleeapho @MichaelSimons

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet muxer reports JSON syntax error when global. ...
global.json is perfectly valid json file, it just has UTF8 BOM encoding which corehost can not process correctly. So yes, build would have ......
Read more >
Unable to locate the .NET SDK as specified by global.json ...
I fixed this problem after discovering a global.json file at the directory root of a C# solution. This json file specified a specific...
Read more >
global.json overview - .NET CLI
Learn how to use the global.json file to set the .NET SDK version when running .NET CLI commands.
Read more >
Untitled
Castro ft d black sihor mp3 songs, #Sample barcode sheet pdf, Miguel simple things remix sharebeast, Pokemon sounds mp3 download, Syntax python pdf...
Read more >
Untitled
Dust jacket book report, Colorin colorado este cuento no ha acabado audio ... songs wild world, Class diagram definition pdf format, Sql error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found