chadly / Geocoding.net

C# GeoCoding / Address Validation API
MIT License
444 stars 157 forks source link

Not making it past await #101

Closed schmidtc63 closed 6 years ago

schmidtc63 commented 6 years ago

I'm running this in mycontrol.ascx.cs:

private async Task<IEnumerable<Address>> getLongLatAsync()
{
    var geocoder = new GoogleGeocoder{ApiKey = "asdfsafsadfaewrafsfsdf"}; //using my actual key
    IEnumerable<GoogleAddress> addresses = await geocoder.GeocodeAsync("1600 pennsylvania ave washington dc");
    return addresses;
}



It never makes it past the "await geocoder". No error. It just stops processing. Are there any non-async calls like there used to be?

chadly commented 6 years ago

I haven't used webforms in a long time. Does it support async/await? How are you calling this method?

If you want to make it behave non-async, you can do it yourself with:

IEnumerable<GoogleAddress> addresses = geocoder.GeocodeAsync("1600 pennsylvania ave washington dc").Result;