How to cast JValue to bool?

Viewed 2438

Recently upgraded to Visual Studio 2017 and am facing a weird issue. I am not able to cast Netwonsoft.Json.Linq.JValue to a bool.

For instance, here is my object "actualObj" which contains a bool (shown in QuickWatch): a JValue object containing a bool

Now, when I cast it to a bool, which should have worked as per the docs, I get an invalid cast exception:invalid cast exception

What should I be doing differently?

1 Answers
Related