Error Xamarin.Forms Android - new HttpClient ()

0

This error appears (image) whenever it arrives in this line:

using (var client = new HttpClient())

Thisisthecompletecode.

usingNewtonsoft.Json;usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Net.Http;usingSystem.Text;usingSystem.Threading.Tasks;namespaceLivrosApp.ApiLivros{publicstaticclassApi{publicstaticasyncTask<IList<Model.Livro>>GetAsync(){using(varclient=newHttpClient()){varjson=awaitclient.GetStringAsync("http://mvalivros.azurewebsites.net/api/livros");
                var livros = JsonConvert.DeserializeObject<List<Model.Livro>>(json);
                return livros;
            }
        }
    }
}

I have already refined the solution, I already gave Clean in the solution and in the projects, I did build, I made rebuild, I activated all the exceptions ... Nothing works ...

I checked all the functions below as well.

    
asked by anonymous 07.10.2016 / 22:40

0 answers