I am currently working on a site (www.kikilikiki.com) and I've incorporated facebook connect into the web app. I connect to facebook through the graph api which returns JSON string content. Authentication is successful, but the parsing of the serialised
JSON string into a JObject doesn't work (throws and exception)... This issue is only occuring on the production server (after clicking the myFacebook button), and not on my local machine.
Example code (C#):
//Grab the user's profile info from Facebook:
string fbUser = "https://graph.facebook.com/me?access_token=" + token;
JObject u = JObject.Parse((string)requestFBData(fbUser)); //requestFBData reads the content returned by facebook and displays when viewed on label control/text
string userFName = u["first_name"].ToString().Replace("\"", ""); //this is where the exception happens as shown below -- when i call the u (JObject)
System.TypeInitializationException: The type initializer for 'Newtonsoft.Json.JsonWriter' threw an exception. ---> System.Security.VerificationException: Operation could destabilize the runtime. at Newtonsoft.Json.JsonWriter..cctor() --- End of inner
exception stack trace --- at Newtonsoft.Json.JsonWriter..ctor() at Newtonsoft.Json.JsonTextWriter..ctor(TextWriter textWriter) at Newtonsoft.Json.Linq.JToken.ToString(Formatting formatting, JsonConverter converters) at Newtonsoft.Json.Linq.JToken.ToString()
at KikilikikiShop.FacebookConnect.Page_Load(Object sender, EventArgs e)
I would appreciate a speedy response if possible coz I'm super stuck but I know the light will shine on me...