Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JsonSerializer exception with Facebook C# SDK

I'm getting the error:

"The type initializer for 'Facebook.JsonSerializer' threw an exception."

with a more specific error of:

"Could not load file or assembly 'Newtonsoft.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified"

like image 671
Auri Rahimzadeh Avatar asked Mar 24 '26 20:03

Auri Rahimzadeh


1 Answers

Ok, I found the issue, so here goes for anyone having the problem:

You need the Newtonsoft JSON library, which you can download from:

http://json.codeplex.com/Release/ProjectReleases.aspx

I used the Newtonsoft.Json.dll in the Net directory.

I actually knew this answer before posting the question, but I figure the answer will help others running into the same issue. Looking into the InnerException of my original exception answered my question :)

like image 138
Auri Rahimzadeh Avatar answered Mar 28 '26 01:03

Auri Rahimzadeh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!