Xamarin Android Exception causes “Frame not in mod

2019-02-24 05:11发布

I am new to Xamarin and currently developing my first app with Android.

I have deliberately created an exception as follows:

throw new Exception("Whoops");

When I hit this line, the Emulator does not give any indication that there has been a problem. If I set a breakpoint on the above line in Visual Studio and then step over it, I get the following error:

Frame not in module The current stack frame was not found in a loaded module.

How can I get Visual Studio to tell me exactly what went wrong? At the moment I can't find any trace of the exception.

4条回答
一夜七次
2楼-- · 2019-02-24 05:43

this comes because debugger can't go to other namespace so if your code calling other methods from other namespace go to it and add a point

查看更多
不美不萌又怎样
3楼-- · 2019-02-24 05:45

This link told me what I needed to know: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/android_debug_log/

You just go to View > Other Windows > Android Device Logging from within Visual Studio. I found it best to use text view.

If there is a better way then please let me know though.

查看更多
Melony?
4楼-- · 2019-02-24 05:49

I work with Xamarin.forms and have the problem with my .droid project...
The error-messages “frame not in module” appears every time, if VS tries to investigate “foreign” code. This, although I have set the option “Enable Just My Code” in the options to the debugger (so... for me it’s a bug).

However, a simple workaround works for me:
In debug mode simply click on the button step over (F10) instead of “step into” (note: this is the button on the right of step over in the upper icon bar of VS).

查看更多
家丑人穷心不美
5楼-- · 2019-02-24 06:02

Only this worked for me on VS 2015:

  1. open "DEBUG -> Windows -> Exception Settings"

  2. tick the parent option "Common Language Runtime Exceptions" so all its children are ticked.

(same works with VS 2013 but on step 1. open "DEBUG -> Exceptions)

查看更多
登录 后发表回答