2

It feels like this should be so simple, but I'm very stuck on it. In VisualStudio 2015 with .Net4.5.2, I'm trying to deserialize JSON into a dynamic object in C#. I've added a NuGet package for Newtonsoft.Json v9.0.0.0 and I've added the proper using statements:

using Newtonsoft.Json; using Newtonsoft.Json.Converters;

Then I create a dynamic object to hold the deserialized data:

dynamic _dynamic = (string.IsNullOrWhiteSpace(val)) ? new ExpandoObject() : JsonConvert.DeserializeObject<ExpandoObject>(val, new ExpandoObjectConverter());

But at compile time, it complains about the ExpandoObjectConverter:

CS0246  C# The type or namespace name 'ExpandoObjectConverter' could not be found (are you missing a using directive or an assembly reference?)

In another solution, I can browse to ExpandoObjectConverter in Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll but in my new project, it "Cannot navigate to the symbol under the caret.".

Thoughts? I'm sure it will turn out to be something stupid I've missed. Thanks.

Jarvis
  • 681
  • 8
  • 33

0 Answers0