Yortw / tweetmoasharp

TweetSharp is a fast, clean wrapper around the Twitter API.
Other
72 stars 22 forks source link

Tweetsharp conflicts with .NET Core 1.0 with different Newtonsoft.Json versions #41

Closed ZOXEXIVO closed 6 years ago

ZOXEXIVO commented 8 years ago

If you add tweetsharp to .NET Core project - that will throws exception in runtime, that can't find Newtonsoft.Json 9.0.0.0, because tweetsharp use 7.0.1 and copy it to output folder. Upgrade Newtonsoft package to lastest Newtonsoft.Json version

Yortw commented 6 years ago

I am keeping TweetMoaSharp on older json.net versions because last time I upgraded to newer versions it caused (a different kind of) grief for existing users. I have however, in 4.0.3, modified the references in the TweetMoaSharp projects so it no longer requires the specific version it was compiled against, newer versions of json.net should also work even though the nugget dependency/compiled references are older.

mitngpl commented 6 years ago

Troy, I have upgraded to 4.0.3 TweetmoaSharp in .NET project with 10.0.1 of Newtonsoft.Json it throws an exception in runtime, that can't find Newtonsoft.Json 8.0.0.0 while creating instance of TwitterService. However, It works fine for the 8.0 version of Newtonsoft.Json.

Is it still using the specific version of Newtonsoft.Json for net40 TweetmoaSharp.dll ?

Yortw commented 6 years ago

Yes, TweetMoaSharp still uses Json.Net 8.0.1 (except for the Mono version which is using 6.0.1). Last time I upgraded the dependencies I got complains from people who also referenced Json.Net but couldn't update to the newer version for some reason so I have deliberately held TMS back to avoid issues for them.

I have checked and all the Json.Net references in the project files still have 'specific version' set to false, so if a newer version is in the folder of your project, TMS should use that happily and not complain unless there is a binary compatibility issue (of which I'm not aware).

I may look at finally upgrading the dependencies in the next version, but I have some other work in progress I want to finish first (and that is going slowly due to other commitments and technical issues).

ahmad-atallah commented 6 years ago

I have some other work in progress I want to finish first

@Yortw I hope by this you mean the new Direct Messages API lol, because nothing is clean and easy as TweetMoaSharp <3

Yortw commented 6 years ago

Yes, that is the largest part. Unfortunately not only is time limited, but the new API is not very like the old, so the code generated used by TMS needs a lot of work. I'm still trying to figure out a good pattern.

mitngpl commented 6 years ago

@Yortw I was expecting the same that it should work without any issue. However, TMS is throwing an exception for the 8.0.0.0 version of newtonsoft,Json

I think the “Specific Version” property is only for build-time, It has no effect on the run time version resolution of the assembly. For now I have fixed this by rebuilding TweetSharp.dll locally with the v10.0.1 Newtonsoft.Json :)