I was hoping to use System.Runtime.Serialization.Json
in a simple Visual Studio Code console app on my Mac OS X but I am running into this compile error:
The type or namespace name 'Json' does not exist in the namespace 'System.Runtime.Serialization' (are you missing an assembly reference?)
Based on this post - Where is the System.Runtime.Serialization.Json namespace?, I added "System.ServiceModel.Web": "1.0.0"
to my project.json file but that did not help. I added 1.0.0
since that's the only version I found in nuget - https://www.nuget.org/packages/System.ServiceModel.Web/
As an alternative, I tried using https://www.nuget.org/packages/Newtonsoft.Json/6.0.8 by adding the following in my project.json - "Newtonsoft.Json": "6.0.8"
but then adding the reference of using Newtonsoft.Json;
again gives a compile error of - The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Ultimately I would like to derserialize a json stream from my VSCode console app, so hoping to get pointers on how that can be done?
System.Runtime.Serialization.Json
is not going to get ported to .Net Core; you did the right thing by going toNewtonsoft.Json
.Unfortunately, you added it only to the
dnxcore50
section; you need to add it to the framework-agnostic dependency section: