Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 由于未处理的异常,此行中断了我的应用程序_C#_Android_Xamarin_Cross Platform - Fatal编程技术网

C# 由于未处理的异常,此行中断了我的应用程序

C# 由于未处理的异常,此行中断了我的应用程序,c#,android,xamarin,cross-platform,C#,Android,Xamarin,Cross Platform,由于未处理的异常,此行中断了我的应用程序 var client = new HttpClient(); var responseMessage =await client.GetAsync("http://localhost:63650/api/student"); //HttpContent content = responseMessage.Content; //var json = await content.ReadAsStringAsync(); var RestUrl = "h

由于未处理的异常,此行中断了我的应用程序

var client = new HttpClient();
var responseMessage =await client.GetAsync("http://localhost:63650/api/student");

//HttpContent content = responseMessage.Content;
//var json = await content.ReadAsStringAsync();


var RestUrl = "http://localhost:63650/api/student";
var uri = new Uri(string.Format(RestUrl, string.Empty));

var response = await client.GetAsync(uri);
if (response.IsSuccessStatusCode)
   {
   var content = await response.Content.ReadAsStringAsync();
   var item = JsonConvert.DeserializeObject<List<Student>>(content);
   }
var-client=new-HttpClient();
var responseMessage=await client.GetAsync(“http://localhost:63650/api/student");
//HttpContent=responseMessage.content;
//var json=await content.ReadAsStringAsync();
var RestUrl=”http://localhost:63650/api/student";
var uri=新的uri(string.Format(RestUrl,string.Empty));
var response=await client.GetAsync(uri);
if(响应。IsSuccessStatusCode)
{
var content=await response.content.ReadAsStringAsync();
var item=JsonConvert.DeserializeObject(内容);
}

添加一个try-catch,找出没有处理的异常,并进行处理。您在哪一行获得此异常,以及异常的信息是什么?哪一行是“this”第行和异常是什么?添加一个try-catch,找出没有被处理的异常并进行处理。您在哪一行获得此异常以及异常的信息是什么?哪一行是“this”行以及异常是什么?