我有一些非常简单的代码抛出RuntimeBinderException
var mockString = "{ Status: \"Aware\" }";
dynamic d = JsonConvert.DeserializeObject(mockString);
OutputString = d.Status;
我已经阅读了很多类似的问题like this one,给出的答案是它是第一次机会异常,我应该在工具>选项>调试中检查“仅我的代码”。
我有两个解决方案的代码。一个工作,一个不工作。两者都选中了“Just My Code”选项。两者都使用相同版本的Newtonsoft.Json(8.0.3)
这是VS 2015,Xamarin Forms在Android上运行。
答案 0 :(得分:0)
In my case I had the debugger break on first chance exceptions for RuntimeBinderException, but when running on Android it was shown as "unhandled" exception in the debugger.
That threw me off for a moment, but after I found out I could continue running without problems I realised it was actually a first chance exception. After turning break on first chance exception of for RuntimeBinderException (since I wasn't interested in those at the time) it worked as expected.
To turn break on first chance exceptions on/off check the menu: Debug -> Windows -> Exception settings