Error “Frame not in module.” in Xamarin.Forms - Android project

你离开我真会死。 提交于 2019-12-11 06:24:46

问题


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."

It happens whenever the thread arrives at the using line.

Frame not in module

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;
            }
        }
    }
}

回答1:


Annoying when this happens!!
There is not one solution to this, have had this issue in past and few things you can try:

  1. Change linking options -->Clean -->build
  2. Change fast deployment --> build
  3. Make sure mdb files are been generated and switch debug info generation to all/pdb files and rebuild
  4. Exception settings -> Common Language Runtime Exceptions (should be ticked) If unticked tick the parent level so that everything below it is ticked
  5. Tools -> Options -> Debugging -> General -> Enable Just My Code (Ticked)
  6. If none of them works then try stepping over (F10) instead of step into (F11)

Hopefully atleast one solution works!!




回答2:


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.



来源:https://stackoverflow.com/questions/39917142/error-frame-not-in-module-in-xamarin-forms-android-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!