Skip to content

Tweetinvi 2.0

Compare
Choose a tag to compare
@linvi linvi released this 18 Jun 17:24

From PCL to .NETStandard

Tweetinvi has been a Portable Class Library (PCL) since 2014 in order to help C# developers to use Twitter in Mono and then in Xamarin.

With .NetStandard PCL will progressively being migrated to .NETStandard libraries and this is why Tweetinvi is no longer a PCL.

New targets: .NETStandard 1.3 and .NETFramework 4.6

During this migration I had to make choices regarding the target. Initially I wanted to keep targeting .NETStandard 1.0 and .NETFramwork 4.0.

Unfortunately I was not able to do so and the minimum target of Tweetinvi 2.0 and later will be .NETStandard 1.3 and .NETFramework 4.6.

New dependency

  • Nito.AsyncEx.Context is a new dependency of Tweetinvi. This library is used to ensure that async functions provided by Tweetinvi correctly "continue" on the same invoker thread.

Removed dependencies

  • Microsoft.Bcl.Async is no longer a nuget dependency as async has been integrated in .NETFramework 4.5.

Sample projects

The new solution includes various new sample projects that you can reuse to start your project.
At the time of this release you can find the following :

Other samples will come in the future. I am currently thinking of WPF and RaspberryPi.

Bug Fixed

A critical bug regarding async and multithreading where the Task completion callback Thread was not the calling thread. This issue was happening in application without any SynchronizationContext like console application.

You can read more about it on the bug at : #473.

ASP.NET (.NET Framework) considerations

By default Tweetinvi should install properly to ALL type of projects with the proper .NET targets.

In some cases the installation of the System.Net.Http and System.Runtime.Serialization.Primitives dependencies can result in dependency conflicts over the version of the DLL to use.

If you encounter an Exception stating that the library System.Net.Http or System.Runtime.Serialization.Primitives could not be found, please add the following configuration in your web.config.

<dependentAssembly>
	<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
	<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>

<dependentAssembly>
	<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
	<bindingRedirect oldVersion="0.0.0.0-4.1.1.1" newVersion="4.1.1.1" />
</dependentAssembly> 

These lines should be added under the <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">.