Visual Studio 断点无法命中怎么办?

经常远程调试服务器打断点是空心的,很抓狂,正确的方法应该是 

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Break();
            }
#endif

然后你用VS附加到远端服务器进程,如果程序运行到该处的时候会自动激活你的VS,不用担心你的小红点问题了!

原文地址:https://www.cnblogs.com/cabbage/p/debugger-not-hit-your-breakpoints.html