Comments in project.json array literals incorrectly read as array elements
See original GitHub issueSteps to reproduce
Add the following to your project.json
"buildOptions": {
"embed": {
"exclude": [
//"Strings.fr.resx"
]
}
}
Expected behavior
Application runs as expected with the fr resources.dll (if “Strings.fr.resx” exists, this isn’t necessary to reproduce) in the output since there is nothing in the exclude array.
Actual behavior
> dotnet run
Illegal characters in path.
Parameter name: path
Same output is in build, publish and some others since it seems to attempt to interpret //"Strings.fr.resx"
as a path
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-rc2-002678)
Product Information:
Version: 1.0.0-rc2-002678
Commit Sha: 3b2ea9d14b
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Expected a JSON object, array or literal.json
1. It'd help to see the stack trace and what led to the error. · I'm trying to store quotes in JSON and...
Read more >Treat JSON types more literally · Issue #26552
I'm wanting the same: ability to import a json as a const literal and get appropriate union types. My json file is a...
Read more >(PostgreSQL 11) Reading in an array of JSON objects (or ...
1 Answer. I didn't find a clear explanation in the docs of the reason why the COPY command wants to have the JSON...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
This string has to be valid JSON and will throw this error if incorrect syntax was encountered. Examples. JSON.parse() does not allow trailing ......
Read more >A beginner's guide to JSON, the data format for the internet
While the key is any string, the value can be a string, number, array, additional object, or the literals, false , true and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s the point: from my perspective (someone new to C#/.NET stack) that’s
perfectly illegal
to use comments in JSON: http://stackoverflow.com/questions/244777/can-i-use-comments-inside-a-json-file http://www.ietf.org/rfc/rfc7159.txt So for me that’s not an issueJSON.Net supports comments