Debug into WCF ServiceReference

Debug的时候碰到的一个问题,在项目中添加了WCF的ServiceReference之后,会自动生成Reference.cs文件,里面包含了call WCF Service 提供的API的方法,但是不管怎么设置断点都没有办法debug进去,找了很久解决的办法,发现原来原因很简单:Reference.cs中所有Class前面都添加了这样一个Attribute:[System.Diagnostics.DebuggerStepThroughAttribute()],VS的调试器不会在有这个Attribute的类中停止,详细可参见MSDN:http://msdn.microsoft.com/zh-cn/library/system.diagnostics.debuggerstepthroughattribute.aspx
原文地址:https://www.cnblogs.com/jiaruistone/p/1918841.html