Type initializer for Tweetinvi


I am trying to use a twitter API TweetInvi but unfortunately facing following error i searched about it alot but couldnt found anything :/ any help will be appriciated This is the error i am getting, well its an inner error the outer ambigous error is

(Outer Error) The type initializer for 'Tweetinvi.TwitterCredentials' threw an exception

(Inner Error)

The assembly with display name 'System.Core' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileLoadException: Could not load file or assembly 'System.Core, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

the image Link is

http://s12.postimg.org/py2zijqal/Prob2.jpg Thanks in advance

asked on Stack Overflow Jun 25, 2014 by user3774347

2 Answers


I solved this problem. newtonsoft.Json library must be same version. I was use NewtonSoft.Json 5.0.8 in my project. I replaced newtonsoft.Json library to 5.0.8 in Tweetinci Source Project and I rebuild it.

Its work :)


In going from v0.9.10.0 to v0.9.3.0 (the newer version broke mono compatibility for some reason), I was also getting a Type initializer problem, with the inner exception talking about Newtonsoft's Json v7.0.0.0 and v6.0.0.0.

Eventually, in my app.config, I deleted this:

  <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
  <bindingRedirect oldVersion="" newVersion="" />

After deleting that, my program ran as expected.

answered on Stack Overflow Nov 12, 2015 by DharmaTurtle

User contributions licensed under CC BY-SA 3.0