LINQ to Twitter for Windows 8 Metro Style Apps

In the Developer Preview of Windows 8, Visual Studio 11 conveniently allowed references to .NET 4.0 apps.  I had blogged previously on how to use LINQ to Twitter with Windows 8.  Subsequently, the Consumer Preview of Windows 8 no longer allowed references to .NET libraries and requires references to Windows 8 Metro Style Application Libraries.  I looked at Portable Class Libraries, but that doesn’t work because LINQ to Twitter is an IQueryable LINQ provider, which isn’t supported.  So, I redirected my focus and am pleased to announce the first beta of LINQ to Twitter for Windows 8.

The download is available on CodePlex at LINQ to TWitter for Windows 8.

In addition to the new LinqToTwitterRT.dll library, the download page includes a Windows 8 Metro Application project, MetroSearchDemo, you can use to try this out.  For an explanation of the code, you can view my previous Windows 8 post, which is similar.


posted @ Wednesday, May 9, 2012 11:04 AM

Comments on this entry:

# re: LINQ to Twitter for Windows 8 Metro Style Apps

Left by JohnMichaelHauck at 5/22/2012 8:58 PM
The code below throws*/works as commented.

var auth = new SingleUserAuthorizer
Credentials = new InMemoryCredentials
ConsumerKey = "DK0...", // twitter Consumer key
ConsumerSecret = "nWw...", // twitter Consumer secret
OAuthToken = "727...", // twitter Access token
AccessToken = "7vq..." // twitter Access token secret
// var twitterCtx = new TwitterContext(auth); // <-- throws exception
var twitterCtx = new TwitterContext(); // <-- works
var searchResponse = (from tweet in twitterCtx.Search where tweet.Type == SearchType.Search && tweet.Query == "john_hauck" select tweet);
foreach (var t in searchResponse)
foreach (var s in t.Results)

An exception of type 'System.ArgumentException' occurred in LinqToTwitterRT.DLL but was not handled in user code
Additional information: Value does not fall within the expected range.
OAuthBase.cs, Line 79: CryptographicKey cryptoKey = mac.CreateKey(keyMaterial);


# re: LINQ to Twitter for Windows 8 Metro Style Apps

Left by Joe Mayo at 5/22/2012 11:47 PM
John, This is now fixed. You can download an updated binary here:


Your comment:

(not displayed)


Live Comment Preview: