Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Debugging 为什么DbgView缺少一些跟踪写入,但是可以在测试运行程序中看到这些跟踪_Debugging_Enterprise Library_Postsharp - Fatal编程技术网

Debugging 为什么DbgView缺少一些跟踪写入,但是可以在测试运行程序中看到这些跟踪

Debugging 为什么DbgView缺少一些跟踪写入,但是可以在测试运行程序中看到这些跟踪,debugging,enterprise-library,postsharp,Debugging,Enterprise Library,Postsharp,有人能解释为什么DbgView遗漏了我的一些跟踪写入吗 我正在使用EnterpriseLibrary5.0日志块,其中包含一个从EntLibCustomTraceListener派生的跟踪侦听器,如下所示 [ConfigurationElementType(typeof(CustomTraceListenerData))] public class DebugTraceListener : CustomTraceListener { public override void Write(

有人能解释为什么DbgView遗漏了我的一些跟踪写入吗

我正在使用EnterpriseLibrary5.0日志块,其中包含一个从EntLib
CustomTraceListener
派生的跟踪侦听器,如下所示

[ConfigurationElementType(typeof(CustomTraceListenerData))]
public class DebugTraceListener : CustomTraceListener
{
    public override void Write(string message)
    {
        Debug.Write(message);
    }

    public override void WriteLine(string message)
    {
        Debug.WriteLine(message);
    }

    public override void TraceData(TraceEventCache eventCache, string source, 
                                 TraceEventType eventType, int id, object data)
    {
        if (data is LogEntry && Formatter != null)
        {
            WriteLine(Formatter.Format(data as LogEntry));
        }
        else
        {
            WriteLine(data.ToString());
        }
    }
}
我可以在VS2010中的Resharper测试运行程序和NUnit GUI测试仪中看到所有跟踪

我还可以将跟踪发送到平面文件侦听器,这将捕获所有跟踪写入, 但是当我使用DbgView(以及TraceSpy)时,只显示了部分跟踪


另一个问题是,我使用PostSharp通过属性将日志作为一个方面添加,而不是直接在业务代码中添加。我已经看到,当另一个应用程序正在运行,同时捕获部分调试流量时,会发生这种情况。如果您正在运行一个应用程序,并且让VS2010调试某个组件,您将看不到任何调试输出被路由到IDE而不是DebugView。如果您同时在同一台机器上测试客户机-服务器应用程序,这会很方便,但可能会导致您描述的问题。除此之外,我还要确保从“捕获”菜单中选中“捕获全局Win32”(我已经看到,即使在我没有预料到的情况下,这也会产生影响)


丢失的消息总是相同的吗?

方面在运行时是否正常工作?可能您没有刷新到在DbgView/TraceSpy中看到所有内容?不,我在运行时得到相同的效果,即DbgView和TraceSpy仅显示部分跟踪写入,而文本日志具有所有跟踪是。。。刚刚注意到一个模式,DbgView displayNope中缺少第1个、第3个等调用。。。这纯粹是运气。我使用NUnit GUI运行了相同的单元测试,没有VS2010。有某种模式。。。有时9中有4个,有时9中有5个,但这两组都是相同的特定轨迹