LINQ to Twitter v3.0 is async, which means that naming conventions have changed as well as the way to call some code. Some changes were for consistency or improving cross-platform operation. It's also a Portable Class Library (PCL), which allows it to run on multiple platforms. Here's a quick rundown on some of your questions:
Try this:
var auth = new SingleUserAuthorizer { CredentialStore = new SingleUserInMemoryCredentialStore { ConsumerKey = ConfigurationManager.AppSettings["consumerKey"], ConsumerSecret = ConfigurationManager.AppSettings["consumerSecret"], AccessToken = ConfigurationManager.AppSettings["accessToken"], AccessTokenSecret = ConfigurationManager.AppSettings["accessTokenSecret"] } };
The previous implementation of GetFileBytes has cross-platform issues, so I removed it. You'll have to write your own code to read the bytes of the file. Here's the old implementation:
/// <summary> /// Reads a file into a byte array /// </summary> /// <param name="filePath">Full path of file to read.</param> /// <returns>Byte array with file contents.</returns> public static byte[] GetFileBytes(string filePath) { byte[] fileBytes = null; using (var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) using (var memStr = new MemoryStream()) { byte[] buffer = new byte[4096]; memStr.Position = 0; int bytesRead = 0; while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0) { memStr.Write(buffer, 0, bytesRead); } memStr.Position = 0; fileBytes = memStr.GetBuffer(); } return fileBytes; }
Here's one of the TweetWithMediaAsync overloads:
Status tweet = await twitterCtx.TweetWithMediaAsync( status, PossiblySensitive, Latitude, Longitude, PlaceID, DisplayCoordinates, imageBytes);
That is now called TweetAsync:
var tweet = await twitterCtx.TweetAsync(status);
Here's an example of CreateFavoriteAsync:
var status = await twitterCtx.CreateFavoriteAsync(401033367283453953ul);
You have to instantiate TwitterContext - here's an example:
var twitterCtx = new TwitterContext(auth);
For more information, you can download the source code and see working examples for multiple technologies. The sample project names have the Linq2TwitterDemos_ prefix:
https://linqtotwitter.codeplex.com/SourceControl/latest#ReadMe.txt
Every API call is documented, as well as documentation on other aspects of LINQ to Twitter: