你如何找到什么调试开关有哪些?或给予一个开关找出被禁用? [英] How do you find what debug switches are available? Or given a switch find out what is being disabled?

查看:140
本文介绍了你如何找到什么调试开关有哪些?或给予一个开关找出被禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此<一个href="http://stackoverflow.com/questions/32877/how-to-remove-vsdebuggercausalitydata-data-from-soap-message"相对=nofollow>问题答案是翻转所拾取的调试器禁用这是造成问题的外部报头的开关。微软的帮助意味着这些开关是用户生成的,并且不列出任何开关。

In this question the answer was to flip on a switch that is picked up by the debugger disabling the extraneous header that was causing the problem. The Microsoft help implies these switched are user generated and does not list any switches.

<configuration>
  <system.diagnostics>
    <switches>
      <add name="Remote.Disable" value="1" />
    </switches>
  </system.diagnostics>
</configuration>

我想知道的是价值Remote.Disable来自于如何找出什么其他的东西可以打开或关闭。目前,它只是一些配置魔法,我不喜欢魔法。

What I would like to know is where the value "Remote.Disable" comes from and how find out what other things can be switched on or off. Currently it is just some config magic, and I don't like magic.

推荐答案

当你怀疑,Remote.Disable停止从附加调试信息到远程请求的应用程序。它里面的.NET框架的方法,使SOAP请求定义。

As you suspected, Remote.Disable stops the app from attaching debug info to remote requests. It's defined inside the .NET framework methods that make the SOAP request.

基本情况是,这些交换机可以在code定义的任何地方,你只需要创建一个新的System.Diagnostics.BooleanSwitch给定的名称和配置文件可以控制它们。

The basic situation is that these switches can be defined anywhere in code, you just need to create a new System.Diagnostics.BooleanSwitch with the name given and the config file can control them.

这特别的一种是在System.ComponentModel.CompModSwitches.DisableRemoteDebugging定义的:

This particular one is defined in System.ComponentModel.CompModSwitches.DisableRemoteDebugging:

public static BooleanSwitch DisableRemoteDebugging
{
    get
    {
        if (disableRemoteDebugging == null)
        {
            disableRemoteDebugging = new BooleanSwitch("Remote.Disable", "Disable remote debugging for web methods.");
        }
        return disableRemoteDebugging;
    }
}

在你的情况下,它可能正在从所谓的 System.Web.Services.Protocols.RemoteDebugger.IsClientCallOutEnabled()的,它被称为的 System.Web.Services.Protocols.WebClientProtocol。 NotifyClientCallOut 的是又被称为的Invoke方法的 System.Web.Services.Protocols.SoapHttpClientProtocol

In your case it's probably being called from System.Web.Services.Protocols.RemoteDebugger.IsClientCallOutEnabled(), which is being called by System.Web.Services.Protocols.WebClientProtocol.NotifyClientCallOut which is in turn being called by the Invoke method of System.Web.Services.Protocols.SoapHttpClientProtocol

不幸的是,据我所知,短反编译的框架和放大器; sea​​ching为

Unfortunately, to my knowledge, short of decompiling the framework & seaching for

new BooleanSwitch

或任何其他继承人的的 System.Diagnostics.Switch 的类, 有没有简单的方法来了解交换机的定义。这似乎是搜索MSDN /谷歌/堆栈溢出的具体情况

or any of the other inheritors of the System.Diagnostics.Switch class, there's no easy way to know what switches are defined. It seems to be a case of searching msdn/google/stack overflow for the specific case

在这种情况下,我只是用反射器及放大器;关注Remote.Disable字符串

In this case I just used Reflector & searched for the Remote.Disable string

这篇关于你如何找到什么调试开关有哪些?或给予一个开关找出被禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆