[英]Error "Frame not in module." in Xamarin.Forms - Android project
Whenever it comes to this line, this error appears:每当涉及到这一行,就会出现这个错误:
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;
}
A new tab appears in VS that says "Frame not in module." VS 中出现一个新选项卡,显示“框架不在模块中”。
It happens whenever the thread arrives at the using
line.每当线程到达using
行时就会发生这种情况。
This is code complete...这是代码完整...
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;
}
}
}
}
Annoying when this happens!!发生这种情况时很烦人!!
There is not one solution to this, have had this issue in past and few things you can try:对此没有一种解决方案,过去曾遇到过此问题,您可以尝试一些方法:
Hopefully atleast one solution works!!希望至少一种解决方案有效!!
I had the same problem and it worked for me after I make the following change.我遇到了同样的问题,在我进行以下更改后它对我有用。
Go to Debug -> Exceptions -> Uncheck Common Language Runtime Exception转到调试 -> 异常 -> 取消选中公共语言运行时异常
Source where I get the solution from: Debbuger doesn't work frame not in module.我从中获得解决方案的来源: Debbuger 不工作框架不在模块中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.