How to import JsonConvert in C# application?

后端 未结 9 1395
栀梦
栀梦 2020-12-03 02:33

I created a C# library project. The project has this line in one class:

JsonConvert.SerializeObject(objectList);

I\'m getting error saying

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 02:53

    JsonConvert is from the namespace Newtonsoft.Json, not System.ServiceModel.Web

    Use NuGet to download the package

    "Project" -> "Manage NuGet packages" -> "Search for "newtonsoft json". -> click "install".

提交回复
热议问题