0

DiagnosticEventSpecification为 IntelliTrace 创建了几个自定义。这按预期工作。

 <DiagnosticEventSpecification enabled="true">
    <Bindings>
      <Binding onReturn="false">
        <ModuleSpecificationId>DiagnosticsTester</ModuleSpecificationId>
        <TypeName>DiagnosticsTester.IntellitraceTest</TypeName>
        <MethodName>TestTrace2</MethodName>
        <MethodId>DiagnosticsTester.IntellitraceTest.TestTrace2(System.String):System.Void</MethodId>
        <ShortDescription _locID="IntelliTraceEnterEvent_ShortDescription">The method TestTrace2.1 was called</ShortDescription>
        <LongDescription _locID="IntelliTraceEvent_LongDescription">View the Locals window for details about the collected data</LongDescription>
        <AutomaticDataQuery level="All" />
      </Binding>
      <Binding onReturn="true">
        <ModuleSpecificationId>DiagnosticsTester</ModuleSpecificationId>
        <TypeName>DiagnosticsTester.IntellitraceTest</TypeName>
        <MethodName>TestTrace2</MethodName>
        <MethodId>DiagnosticsTester.IntellitraceTest.TestTrace2(System.String):System.Void</MethodId>
        <ShortDescription _locID="IntelliTraceExitEvent_ShortDescription">The method TestTrace2.1 returned</ShortDescription>
        <LongDescription _locID="IntelliTraceEvent_LongDescription">View the Locals window for details about the collected data</LongDescription>
        <AutomaticDataQuery level="All" />
      </Binding>
    </Bindings>
    <CategoryId>IntelliTrace.generated.8889ce9d-2320-40c0-a6bf-dfac215354d2</CategoryId>
    <SettingsName _locID="">DiagnosticsTester.IntellitraceTest.TestTrace2</SettingsName>
    <SettingsDescription _locID=""></SettingsDescription>
  </DiagnosticEventSpecification>

当我尝试使用它时,ProgrammableDataQuery它无法捕获事件。根据 ProssesMon 和“Fusion log viewer”的说法,Intellitrace 从不尝试加载我的自定义 dll。定义如下所示:

   <DiagnosticEventSpecification enabled="true">
    <Bindings>
      <Binding>
        <ModuleSpecificationId>DiagnosticsTester</ModuleSpecificationId>
        <TypeName>DiagnosticsTester.IntellitraceTest</TypeName>
        <MethodName>TestTrace2</MethodName>
        <MethodId>DiagnosticsTester.IntellitraceTest.TestTrace2(System.String):System.Void</MethodId>
        <ProgrammableDataQuery>
          <ModuleName>UnikDataQuery.dll</ModuleName>
          <TypeName>UnikDataQuery.TestDataQuery</TypeName>
        </ProgrammableDataQuery>
      </Binding>
    </Bindings>
    <CategoryId>IntelliTrace.generated.8889ce9d-2320-40c0-a6bf-dfac215354d2</CategoryId>
    <SettingsName _locID="">DiagnosticsTester.IntellitraceTest.TestTrace2</SettingsName>
    <SettingsDescription _locID=""></SettingsDescription>
  </DiagnosticEventSpecification>

我已将 dll 放置在 IntelliTrace 独立收集器之外以及 IntelliTrace 的 VS2015 文件夹中C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\14.0.0

4

1 回答 1

0

带有 PDQ 的 dll 应该放在带有IntelliTace.exe程序的文件夹中。换句话说,如果您使用集成到 Visual Studio 中的 IntelliTrace,则应将UnitQuery.dll复制到您提到的文件夹中,即:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\14.0.0

顺便说一句,在这个文件夹中,您还可以找到 Microsoft.VisualStudio.DefaultDataQueries,它是 VS 使用的具有默认 PDQ 的 dll。

但是,如果您使用独立集合,则必须将 dll 复制到其安装目录。

我做了很多次,效果很好。如果您的 dll 是在平台目标设置为 Any CPU 的情况下编译的,这也值得验证。它将允许避免兼容性问题。

我的最后一条评论是,您的带有 PDQ 的 dll 不仅需要捕获日志,还需要:

  • 在VS中打开它
  • 使用 IntelliTrace API 对其进行分析。

例如,如果您:

  • 使用独立集合来捕获日志
  • 你想在 Visual Studio 中打开这个日志

然后必须将UnitQuery.dll复制到这两个位置。

于 2016-01-14T07:22:16.940 回答