I am working in c# 4.0 to read a signed request I am using the following code
FacebookApp fap = new FacebookApp();
fap.AppId = "789485219211963"; // App ID
fap.AppSecret = "365ee9f5823698536767d608cf572a49";
string requested_Data = Request.Form["signed_request"];
FacebookSignedRequest fsr = fap.ParseSignedRequest(requested_Data);
IDictionary<string, string> myDic = fsr.Dictionary;
string name = myDic["name"];
string algorithm = myDic["algorithm"];
Response.Write(requested_Data + "<br>" + algorithm + "<br>" + name + "<br>");
But on the highlighted line I received following exception
Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I downloaded Newtonsoft.Json. release 1 instead of release 2 but it still not working. Can someone kindly help me to solve this problem, also please guide me either my way of reading signed request is correct or not if not please specify the correct way.
Thanks:
I'm guessing you donwloaded Newtonsoft.Json v4.0, not 3.5. Last version of 3.5 is release 8.
http://json.codeplex.com/releases/view/50552
I guess that you might be able to do a version forward in your web.config/app.config in order to use 4.0 instead of 3.5, because some library you are using is probably built against the 3.5 version of Newtonsoft.
You can update it with its nuget package 'Newtonsoft.Json' using the package manager.
PM> update-package newtonsoft.json
In package manager console Visual Studio 2013
PM> Install-Package Newtonsoft.Json
Then restart Visual Studio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With