问题
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