Getting Data for a Blazor Application [6 of 11] | Beginner's Series to: Blazor

Play Getting Data for a Blazor Application [6 of 11] | Beginner's Series to: Blazor

The Discussion

  • User profile image
    timtrout1968
    When following along from home, in your Program.cs you may need to add:

    app.MapControllers();

    So your ForecastController can be found at runtime, depending on which template and with SDK you started your project with. I discovered this in a roundabout way when I kept getting and exception:

    JsonReaderException: '<' is an invalid start of a value

    from the call to Http.GetFromJsonAsync, which was returning an html error page instead of a deserializable JSON collection of WeatherForecasts.

Add Your 2 Cents