Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Newtonsoft.Json Dependency issue

My project uses Newtonsoft.json V4.5. Now I have a requirement to integrate twitter oAuth in my project.

I decided to use Tweetsharp.dll for the integration. Got up with an issue of dependency conflict of Newtonsoft.Json that Tweetsharp requires Newtonsoft.json 3.5.

The issue is that I cannot replace my newer version of Newtonsoft.Json from my project as it affects other features.

Please help me to resolve this issue.

Server Error in '/' Application.

 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)

  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

  Exception Details: System.IO.FileLoadException: 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)

 Source Error: 


 Line 188:            if (CallbackUrl != null && CallbackUrl.Trim().Length > 0)
 Line 189:            {
 Line 190:                twitter =     FluentTwitter.CreateRequest().Configuration.UseHttps().Authentication.GetRequestToken(ConsumerKey, ConsumerSecret, CallbackUrl);
 Line 191:            }
 Line 192:            else

 Source File: C:\Users\hnarikkoden\Desktop\Socxo\B2\App_Start\TwitterInfo.cs    Line: 190 

  Assembly Load Trace: The following information can be helpful to determine why the   assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' could not be loaded.
like image 313
Hamid Narikkoden Avatar asked Nov 12 '22 09:11

Hamid Narikkoden


1 Answers

There's no way you can reference both libraries so your best shot would be to either :

-edit the TweetSharp project as it is open source and try to "updgrade" it by yourself

-post the issue on the TweetSharp Github and ask for it to be updated

like image 139
Padrus Avatar answered Nov 15 '22 13:11

Padrus