Cannot access methods Newtonsoft.JSON .Net Core 2.*

杀马特。学长 韩版系。学妹 提交于 2019-12-11 06:01:50

问题


I'm have a solution with multiple projects all using .Net Core 2.1 (VS 2017). I can use Newtonsoft.JSON.JsonConvert in my web project without any problem for serializing and deserializing objects.

Another project in the same solution has the same Nuget packages (version and SDK) as my web project. Intellisense recognizes JsonConverter, but the only method that shows is Equals, so no SerializeObject or DeserializeObject.

When I open the JsonConvert Definition within my console application it has the namespace Newtonsoft.Json and a public abstract class JsonConverter

When I do the same within the web project I get the namespace Newtonsoft.Json and a public static class JsonConvert

The last one contains the methods I want to use, but I've no idea why this problem is occurring and how to solve it.


回答1:


Looks like I needed JsonConvert instead of JsonConverter...



来源:https://stackoverflow.com/questions/53666358/cannot-access-methods-newtonsoft-json-net-core-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!