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

  • Home
  • SEARCH
  • 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 9214277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:56:26+00:00 2026-06-18T01:56:26+00:00

I am trying to Deserialize a JSON response from Google Maps Geocode. Those are

  • 0

I am trying to Deserialize a JSON response from Google Maps Geocode.

Those are the classes I coded based on the response.

public class GoogleGeoCodeResponse
    {
        public string status { get; set; }
        public results[] results { get; set; }
    }

public class results
    {
        public address_component[] address_components { get; set; }
        public String formatted_address { get; set; }
        public Geometry geometry { get; set; }
        public Boolean partial_match { get; set; }
        public string[] types { get; set; }
    }

public class address_component
    {
        public String long_name { get; set; }
        public String short_name { get; set; }
        public String[] types { get; set; }
    }

public class Geometry
    {
        public bounds_viewport bounds { get; set; }
        public LatLong location { get; set; }
        public String location_type { get; set; }
    }

public class bounds_viewport
    {
        public LatLong northeast { get; set; }
        public LatLong southwest { get; set; }
    }

public class LatLong
    {
        public double lon { get; set; }
        public double lat { get; set; }
    }

On my form button click I use this code.

var json = new WebClient().DownloadString("url");
GoogleGeoCodeResponse test = JsonConvert.DeserializeObject<GoogleGeoCodeResponse>(json);

MessageBox.Show(test.results[0].geometry.location.lat + " / " + test.results[0].geometry.location.lon);

Then I wanted to see if I get the correct information but I’m getting:

“Error 1 Inconsistent accessibility: property type ‘WindowsFormsApplication1.results[]’ is less accessible than property ‘WindowsFormsApplication1.GoogleGeoCodeResponse.results'”

I’ve looked a bunch of post with the same problem but they always had something private or internal somewhere that would lead to this error. As you can see everything I declared is public.

I don’t understand why something public inside of a class would be more accessible than the class itself.

I am fairly new to C# and JSON so this might be something really simple.

  • 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-18T01:56:27+00:00Added an answer on June 18, 2026 at 1:56 am

    Ok so I took all of my class and put the code out of my form’s class and it worked. I put it back in the class and it still worked I don’t know what I have changed, maybe it was just bugged or something anyway thanks for the help!

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

Sidebar

Related Questions

I am trying to deserialize a json response from a google api, so i
I am trying to deserialize a nested json string public class recentlySearchedAdd { public
I am trying to deserialize a JSON string into a class instance in Haxe.
I am trying to serialize/deserialize JSON in Android using GSON. I have two classes
I'm trying to deserialize a json response and am getting the value cannot be
I am trying to parse JSON response from a httpwebrequest fetch and a little
I'm trying to deserialize the following JSON response: [{pollid:1, question:This is a test, start:2011-06-28,
I have a JSON multi-level response that I need to deserialize and from the
I'm trying to deserialize a JSON string with the following syntax into C# classes,
I'm trying to deserialize json data services recieved from a web server into an

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.