Ilya Chernomordik
Ilya Chernomordik

Reputation: 30235

Cannot comment dnxcore in project.json (Illegal character error)

I have a strange problem when I comment out the dnxcore in the asp.net 5 (or a library) project. If I want to run only on .net framework (dnx), then I can delete the dnxcore from the project.json which works fine, but when I just comment it out there is an error that it's an illegal symbol:

enter image description here

Seems like a bug in VS or framework to me, is there any way to fix it?

P.S. I want to turn dnxcore off because the Azure Storage 6.0.0 does not support it, though I guess this is irrelevant to the question

Upvotes: 1

Views: 421

Answers (3)

Victor Hurdugaci
Victor Hurdugaci

Reputation: 28425

The DNX json parser doesn't support comments. More details here: https://github.com/aspnet/Announcements/issues/24

Upvotes: 1

Ed Chapel
Ed Chapel

Reputation: 6932

Instead of commenting out the data, can you instead give it a different name?

...
"frameworks": {
  "dnx451": {}

  "//dnxcore50": {
    "dependencies": {
...

The idea here being that since JSON doesn't support comments, you can change the name of the property and it will be ignored.

Upvotes: 0

Ilya Chernomordik
Ilya Chernomordik

Reputation: 30235

It seems that comments in json are not supported at all, so the bug here is that Visual Studio shows them in green as if it's real comment. More details on json comments in another post.

Upvotes: 0

Related Questions