解决方法
很好的解释它here …
This is an attribute that you put against a method to tell the debugger “nothing to do with me guv’. Ain’t my code!”. The gullible debugger will believe you,and won’t break in that method: using the attribute makes the debugger skip the method altogether,even when you’re stepping through code; exceptions that occur,and are then caught within the method won’t break into the debugger. It will treat it as if it were a call to a Framework assembly,and should an exception go unhandled,it will be reported one level up the call stack,in the code that called the method.
代码示例:
public class Foo { [DebuggerNonUserCode] public void MethodThatThrowsException() { ... { }
原文地址:https://www.jb51.cc/csharp/94670.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。