Issues with Tweetinvi - Binaries

Feb 26, 2015 at 11:22 PM
I am new to Tweetinvi, I just downloaded the latest version. and I am trying to use it based on the documentation i read the website.

i just tried to implement this line of code:
TwitterCredentials.SetCredentials(TweetKey.AccessToken, TweetKey.AccessTokenSecret, TweetKey.ConsumerKey, TweetKey.ConsumerSecret);

and I keep getting this error:
System.TypeInitializationException: The type initializer for 'Tweetinvi.TwitterC
redentials' threw an exception. ---> System.TypeInitializationException: The typ
e initializer for 'Tweetinvi.TweetinviContainer' threw an exception. ---> System
.IO.FileLoadException: Could not load file or assembly 'System.Core, Version=2.0
.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one
of its dependencies. The given assembly name or codebase was invalid. (Exceptio
n from HRESULT: 0x80131047)
at Autofac.Builder.RegistrationData..ctor(Service defaultService)
at Autofac.Builder.RegistrationBuilder`3..ctor(Service defaultService, TActiv
atorData activatorData, TRegistrationStyle style)
at Autofac.Builder.RegistrationBuilder.ForTypeTImplementer
at Autofac.RegistrationExtensions.RegisterType[TImplementer](ContainerBuilder
at Tweetinvi.Injectinvi.AutofacContainer.RegisterType[T,U](RegistrationLifeti
me registrationLifetime)
at Tweetinvi.TweetinviModule.Initialize()
at Tweetinvi.Injectinvi.AutofacContainer.InitializeModules()
at Tweetinvi.Injectinvi.AutofacContainer.Initialize()
at Tweetinvi.Injectinvi.AutofacContainer..ctor()
at Tweetinvi.TweetinviContainer..cctor()
--- End of inner exception stack trace ---
at Tweetinvi.TweetinviContainer.ResolveT
at Tweetinvi.TwitterCredentials..cctor()
--- End of inner exception stack trace ---
at Tweetinvi.TwitterCredentials.SetCredentials(String userAccessToken, String
userAccessSecret, String consumerKey, String consumerSecret)
at DigitalMedia.Main.Program.Main(String[] args)
Feb 26, 2015 at 11:25 PM

I need the following information to help you:
  • What are you targeting (Windows 7, 8, 10 - Windows Phone 8/8.1, Windows RT)
  • How did you get the library (download on the website vs. nuget)
Sorry for this problem.
Feb 27, 2015 at 12:03 AM
Edited Feb 27, 2015 at 12:05 AM
Hi Linvi,

I am using Windows 7
I downloaded the library from the website and added them to my project.

Thank you.
Feb 27, 2015 at 12:07 AM
Thanks for the response, can you tell me which .NET Framework the applicatin targets?

Feb 27, 2015 at 12:12 AM
I am using .NET Framework 4.0
Feb 27, 2015 at 12:13 AM
Could you try and target .NET Framework 4.5 and let me know what happens please.
Feb 27, 2015 at 12:30 AM

It is getting quite late here. Please keep me up to date with your issue but I will have to reply tomorrow.

Feb 27, 2015 at 12:43 AM
I am using VS2010, so I think I cannot use .NET framewok 4.5 on it.
Feb 27, 2015 at 9:34 AM
Please try using Nuget (Install-Package TweetinviAPI).

I have just tested (Windows 7 + Visual Studio 2010 + .NET Framework 4) and it works, I will try later from the binaries directly.

Marked as answer by linvi on 2/27/2015 at 10:14 AM
Feb 27, 2015 at 10:21 AM
Thanks a lot Linvi, It works now.

Please is there a documentation of the API that shows the Methods in it and what it returns?

Thank you.
Feb 27, 2015 at 10:59 AM
Well you have the documentation here :
I have not created any documentation that shows what each method is returning. Instead each method name should be clear enough for you to know what it will return.

If you find any method for which you are not sure what it returns, please let me know.