locked
Getting Started Blog sample fails

    Question

  • The getting started blog sample fails at FeedData.cs line 174. So, MS publishes a sample that doesn't actually work!

                var matches = _feedDataSource.Feeds.Where((feed) => feed.Title.Equals(title));
    

    I have tried the download from VS 2012 > Help > Samples > "Getting Started with C# and Visual Basic: Hello World and Blog reader sample", as well as the complete C# samples pack from the code.msdn Windows 8 app samples download page.  I tried the sample code with VS 2012 Express and with VS 2012 Premium. Both fail at the same line.

    The error message is:

    An exception of type 'System.NullReferenceException' occurred in WindowsBlogReader.exe but was not handled in user code

    Additional information: Object reference not set to an instance of an object.

    If there is a handler for this exception, the program may be safely continued."


    Thursday, November 22, 2012 12:57 AM

Answers

  • Suppressing the feed1 reference @ line 104 will make it run:

                // this.Feeds.Add(await feed1);
    

    • Marked as answer by Mark J Means Saturday, November 24, 2012 12:56 AM
    Thursday, November 22, 2012 7:17 AM

All replies

  • Suppressing the feed1 reference @ line 104 will make it run:

                // this.Feeds.Add(await feed1);
    

    • Marked as answer by Mark J Means Saturday, November 24, 2012 12:56 AM
    Thursday, November 22, 2012 7:17 AM
  • check to see if feed is null

    var matches = _feedDataSource.Feeds.Where((feed) =>feed!=null && feed.Title.Equals(title));

    so any null feed will be ignored

    • Proposed as answer by cordova_dev Friday, January 30, 2015 8:30 AM
    Wednesday, December 12, 2012 3:31 PM
  • For the past few days, i was working on another app: Channel9 Blog Reader.
    It's same as the Windows 8 Blog Reader, the main difference being the feed links changed from "windowsteamblog.com" or "blogs.windows.com" to "channel9.msdn.com".

    And also there are a couple of minor changes as it is a Windows 8.1 app & not Windows 8 app, so it will be better if u read this article about migrating a Windows 8 app to Windows 8.1 app :-
    Migrating a Win 8 app to Win 8.1 app


    Here is the link to the source code of the app :-

    Channel9 Blog Reader App source code

    Tuesday, February 3, 2015 8:12 AM