UWP-060 - UWP Weather - Testing Location in the Phone Emulator

Sign in to queue

The Discussion

  • User profile image
    SonPhan

    I have an iPhone 6s, and you're back.

  • User profile image
    pwmusic

    If the emulator install fails, check Windows Features to ensure Hyper-V is present and enabled. If it isn't, make sure you have Windows 10 Pro installed. Windows 10 Home does not contain the Hyper-V feature.

  • User profile image
    Lou Elston

    What you have in downloaded MainPage.xml.cs is a little different from what you had in the video. In particular this...
    RootObject myWeather =
    await OpenWeatherMapProxy.GetWeather(
    lat,
    lon);
    Using both cases of the code, when running, when it returns from the GetWeather call, it errors with "SerilizationException was unhandled by user code"...
    An exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.ni.dll but was not handled in user code

    Additional information: Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''.

    I copied your code into my sln...same problem. How to fix?

    Also, (newbie question), how to get your downloaded sln to run, it will not execute, errors out.

  • User profile image
    Lou Elston

    Needed to add the + "&appid=2de143494c0b295cca9337e1e96b00e0"; Else the response had "invalid Operation" in it.


    var url = String.Format("http://api.openweathermap.org/data/2.5/weather?lat={0}&lon={1}&units=imperial", lat, lon) + "&appid=2de143494c0b295cca9337e1e96b00e0";

Add Your 2 Cents