1

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

Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207

3 Answers3

1

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

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
0

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.

Community
  • 1
  • 1
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207
0

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.

Ed Chapel
  • 6,842
  • 3
  • 30
  • 44
  • It won't work that easy unfortunately since the file is parsed and //dnxcore50 is an unsupported framewok error happens there. But I guess I'll just delete it, the history is in source control anyway :) – Ilya Chernomordik Oct 22 '15 at 10:56