The type or namespace name 'Json' does not exist in the namespace 'System' (are you missing an assembly reference?)

后端 未结 2 1147
日久生厌
日久生厌 2021-01-22 22:24

I am using .NET Framework 4.5 and I\'m having this issue. The type or namespace \'Json\' does not exist in the namespace \'System\'

So, I tried to Inst

相关标签:
2条回答
  • 2021-01-22 23:07

    using Newtonsoft.Json; Should get the job done

    now you can use :
    JsonConvert.SerializeObject JsonConvert.DeserializeObject

    0 讨论(0)
  • 2021-01-22 23:23

    That package is discontinued and shouldn't be used any more.

    If you have a console application, I could recommend two options:

    • JSON.NET. Not a part of the .NET Framework itself, but much faster than Microsofts implementation;
    • Microsofts implementation of the JavaScriptSerializer.

    Both are capable of reading and writing JSON. I find the JSON.NET library easier to use and more feature complete.

    0 讨论(0)
提交回复
热议问题