我为IntelliTrace创建了几个自定义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和“融合日志查看器”,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 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\14.0.0的VS2015文件夹中。
发布于 2016-01-14 07:22:16
带有PDQ的dll应该放在一个带有IntelliTace.exe程序的文件夹中。换句话说,如果您使用集成到Visual中的IntelliTrace,那么应该将UnitQuery.dll复制到您提到的文件夹中,即:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\14.0.0顺便说一句,在这个文件夹中,您还可以找到VS使用的具有默认PDQ的Microsoft.VisualStudio.DefaultDataQueries。
但是,如果使用独立集合,则必须将dll复制到其安装目录。
我做了很多次,效果很好。如果您的dll是用平台目标设置为任何CPU编译的,这也是值得验证的。它将允许避免兼容性问题。
我最后的评论是,使用PDQ的dll不仅需要捕获日志,还需要:
例如,如果您:
然后必须将UnitQuery.dll复制到两个位置。
https://stackoverflow.com/questions/34687029
复制相似问题