Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8935763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:04:06+00:00 2026-06-15T10:04:06+00:00

Using Json.Net in this Windows Phone application, I seem to be getting an exception

  • 0

Using Json.Net in this Windows Phone application, I seem to be getting an exception from the JSON deserializer, which is the direct result of “events” returning as null. Here is what is important of the app’s MainPage.xaml:

 <ListBox x:Name="event_list" >
       <ListBox.ItemTemplate>
           <DataTemplate>
               <StackPanel Orientation="Vertical">
                   <TextBlock Text="{Binding name}" TextWrapping="Wrap" />
                   <TextBlock Text="{Binding description}" Style="{StaticResource PhoneTextSubtleStyle}" />
               </StackPanel>
           </DataTemplate>
       </ListBox.ItemTemplate>

Here is the app’s MainPage.xaml.cs:

 using Microsoft.Phone.Controls;
 using Microsoft.Phone.Tasks;
 using System;
 using System.IO;
 using System.Linq;
 using System.Net;
 using System.Windows;
 using System.Windows.Controls;
 using System.Xml;

 using Newtonsoft.Json;
 using System.Collections.Generic;

 namespace WPDevNorthTX
 {
     public partial class MainPage : PhoneApplicationPage
     {



    #region Constructor

    // Constructor
    public MainPage()
    {
        InitializeComponent();
    }

    #endregion

    void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
    {

        if (e.Error != null)
        {
            return;
        }

        List<Result> events = JsonConvert.DeserializeObject<List<Result>>(e.Result);
        this.event_list.ItemsSource = events;
    }

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        string requestUrl = @"https://api.meetup.com/2/events?key=766be5c39495111785c7947714359&sign=true&group_urlname=Windows-Phone-App-Development-Group-DFW-Dallas-Texas";

        WebClient webClient = new WebClient();
        webClient.DownloadStringAsync(new Uri(winPhoneGeekTweetsUrl));
        webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted);
    }
}

     public class Result
     {
         public string visibility { get; set; }
         public string status { get; set; }
         public int maybe_rsvp_count { get; set; }
         public string id { get; set; }
         public int utc_offset { get; set; }
         public int duration { get; set; }
         public object time { get; set; }
         public int waitlist_count { get; set; }
         public int yes_rsvp_count { get; set; }
         public object created { get; set; }
         public object updated { get; set; }
         public string event_url { get; set; }
         public string description { get; set; }
         public int headcount { get; set; }
         public string name { get; set; }
         public Group group { get; set; }
         public Venue venue { get; set; }
     }

     public class RootObject
     {
         public List<Result> results { get; set; }
     }

 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:04:07+00:00Added an answer on June 15, 2026 at 10:04 am

    Your json requires at least 4 classes and too many fields. Therefore I would go dynamic way

    dynamic dynObj = JsonConvert.DeserializeObject(e.Result);
    
    Console.WriteLine(dynObj.meta.description);
    
    foreach (var result in dynObj.results)
    {
        Console.WriteLine(result.description);
    }
    

    OR

    var dynObj = (JObject)JsonConvert.DeserializeObject(e.Result);
    
    Console.WriteLine(dynObj["meta"]["description"]);
    
    foreach (var result in dynObj["results"])
    {
        Console.WriteLine(result["description"]);
    }
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is nuts. I have an ASP.NET MVC application using Windows authentication that, amongst
I'm using JSON.Net for serializeation. I need my data to look like this json
I'm using Json.Net to handle the deserialzing of the response of API calls from
I am using JSON.NET in C# to parse a response from the Klout API.
I need to select some values from a json response. Im using json.net, fine
Currently I am using the terrific Linq 2 Json.net (by newtonsoft), which is a
I'm using the following code to request data from an ASP.net MVC application. I'm
I am using JSON.NET which has the LinqBridge .dll merged in. LinqBridge allows Linq
I am using json.net to parse objects and delivering them to a webservice I
I am using Json.NET to serialize an object graph. For each object that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.