Why does VS2010 always break on exception from MethodInfo.Invoke?

一个人想着一个人 提交于 2019-12-05 08:54:54
exsulto

Yes, with every exception check-box is un-checked it breaks on only these Invoke exceptions. All the other exceptions work fine.

The great news is that an anonymous genius gave me a work-around:

delegate void VoidTest(); 
VoidTest test = 
    (VoidTest)Delegate.CreateDelegate(typeof(VoidTest), o, method.Name); 
test(); 

These exceptions do land in the exception handler just as expected! =)

Are you sure that "Break on first-chance exceptions" is disabled? Go to Debug -> Exceptions and make sure everything is turned off.

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