0
This error (image) appears whenever you arrive on this line:
using (var client = new HttpClient())
This is the complete code.
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace LivrosApp.ApiLivros
{
public static class Api
{
public static async Task<IList<Model.Livro>> GetAsync()
{
using (var client = new HttpClient())
{
var json = await client.GetStringAsync("http://mvalivros.azurewebsites.net/api/livros");
var livros = JsonConvert.DeserializeObject<List<Model.Livro>>(json);
return livros;
}
}
}
}
I have remade the solution, I already gave Clean in the solution and in the projects, I built, I rebuilt, activated all the exceptions... Nothing works...
I marked all functions below also.
Dude, go to Debug > Windows > Exceptions and tell me if the option Common Language Runtime Exceptions is marked with a tick ( ), a square or is not marked
– Jéf Bueno
Hi. All this... I put in question an image.
– Luis Medeiros
Add a Try/Cath to check the generated Exception. Something else are you testing this on an Android VM? Check if there is internet in this VM?
– Tiago