WPF application - cannot find correct .dll

Oct 30, 2011 at 9:57 AM

Hi

I am developing a small twitter application with WPF 4.0, but I cannot seem to get any .dll working.  When I use the 4.0 binaries, LinqToTwitter.dll, I get a compilation error (Error 1 The type or namespace name 'LinqToTwitter' could not be found (are you missing a using directive or an assembly reference?) and when I try to use the 4.0BinariesSilverlight LinqToTwitterAg.dll, the code compiles but when i try to instantiate the context 

private TwitterContext twitterCtx = new TwitterContext();

I get the following error :-

Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

My code is as follows :-

        private TwitterContext twitterCtx = new TwitterContext();

        public List<Tweets> GetSearchResults(string strSearchTerm)
        {
            List<Tweets> tweets = new List<Tweets>();

            var queryResults =
                from search in twitterCtx.Search
                where search.Type == SearchType.Search &&
                      search.Query == strSearchTerm &&
                      search.Page == 2 &&
                      search.PageSize == 5
                select search;

            foreach (var search in queryResults)
            {
                // here, you can see that properties are named
                // from the perspective of atom feed elements
                // i.e. the query string is called Title
                Console.WriteLine("\nQuery:\n" + search.Title);

                foreach (var entry in search.Entries)
                {
                }
            }

            return tweets;
        }

Oct 30, 2011 at 5:04 PM

Ok redone my code and now the 4.0Binaries works.  So my code was not working correctly.

Coordinator
Oct 30, 2011 at 6:37 PM

Good to hear. Once it's ready, I can add a link from this site to yours if you like.

@JoeMayo

Oct 31, 2011 at 7:29 AM

Sure Joe!

It would be excellent to have a link from your site, however I am still in the initial stages and seeing that this is a fun project, could take me a while :)