11

I installed json.net using the NuGet package manager:

enter image description here

But now when I actually try to use the thing by doing something like:

JObject message = Jobject.parse(someJson);

I am getting Type or namespace name 'JObject' could not be found.

How do I include it in my solution after NuGet installation?

1
  • 1
    nuget adds the dll to your project references. Jobject is not in your current namespace so you need to write out Newtonsoft.Json.Linq.JObject or add the using statement as Thomas suggested. Commented Mar 17, 2014 at 16:09

1 Answer 1

21

You need to import the namespace containing the JObject class:

using Newtonsoft.Json.Linq;
Sign up to request clarification or add additional context in comments.

3 Comments

Just an extra tip. You can right click "JObject" and look for "Resolve". It will add the namespace...if it is able to be found.
@granadaCoder, you can also press Ctrl + . on JObject to invoke the smart menu
Not sure why this isn't in their getting started guide

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.