2016-08-24 5 views
0

IntelliTraceを使用すると、メソッドへの参照によって渡された文字列の出力と、同じイベント(またはまったく)のメソッドの結果を見ることができません。IntelliTraceの引数リファレンスによる参照

方法例:

<DiagnosticEventSpecification> 
    <CategoryId>stackoverflow.test.application</CategoryId> 
    <SettingsName _locID="settingsName.Test.Application.Reference">VerifyIDFromBackEnd called</SettingsName> 
    <SettingsDescription _locID="settingsDescription.Test.Application.Reference">VerifyIDFromBackEnd was called</SettingsDescription> 
    <Bindings> 
     <Binding onReturn="false"> 
      <ModuleSpecificationId>stackoverflow.test.application</ModuleSpecificationId> 
      <MethodName>ByReferenceTestMethod</MethodName> 
      <MethodId>Test.Application.TestClass.ByReferenceTestMethod(System.ArgumentException,System.String&amp;):System.Boolean</MethodId> 
      <ShortDescription _locID="shortDescription.Test.Application.Reference.called">Method 'ByReferenceTestMethod' called</ShortDescription> 
      <LongDescription _locID="longDescription.Test.Application.Reference.called">ByReferenceTestMethod called with ArgumentException parameter name "{0}" and message "{1}"</LongDescription> 
      <TypeName>Test.Application.TestClass</TypeName> 
      <DataQueries> 
       <DataQuery index="1" maxSize="2048" type="String" name="Exception parameter" _locID="dataquery.Test.Application.Reference.exception.Paramname" query="m_paramName" /> 
       <DataQuery index="1" maxSize="2048" type="String" name="Exception message" _locID="dataquery.Test.Application.Reference.exc5eption.Message" _locAttrData="name" query="_message" /> 
     </DataQueries> 
     </Binding> 
     <Binding onReturn="true"> 
      <ModuleSpecificationId>stackoverflow.test.application</ModuleSpecificationId> 
      <MethodName>ByReferenceTestMethod</MethodName> 
      <MethodId>Test.Application.TestClass.ByReferenceTestMethod(System.Exception,System.String&amp;):System.Boolean</MethodId> 
      <ShortDescription _locID="shortDescription.Test.Application.Reference.result">Method 'ByReferenceTestMethod' completed</ShortDescription> 
      <LongDescription _locID="longDescription.Test.Application.Reference.result">ByReferenceTestMethod returned result "{0}" with an unknown referenceArgument</LongDescription> 
      <TypeName>Test.Application.TestClass</TypeName> 
      <DataQueries> 
       <DataQuery index="-1" maxSize="0" type="Boolean" name="Reference Result" _locID="dataquery.Test.Application.Reference.result" _locAttrData="name" query="" /> 
      </DataQueries> 
     </Binding> 
    </Bindings> 
</DiagnosticEventSpecification> 

collectionplan.xml例では、参照引数参照して動作していない:

<LongDescription _locID="longDescription.Test.Application.Reference.result">ByReferenceTestMethod returned result "{0}" with referenceArgument "{1}"</LongDescription> 
<TypeName>Test.Application.TestClass</TypeName> 
<DataQueries> 
    <DataQuery index="-1" maxSize="0" type="Boolean" name="Reference Result" _locID="dataquery.Test.Application.Reference.result" _locAttrData="name" query="" /> 
    <DataQuery index="2" maxSize="4096" type="String" name="referenceArgument" _locID="dataquery.Test.Application.Reference.Reference.Value" _locAttrData="name" query="" /> 
</DataQueries> 

この参照引数参照することなく作業

public bool ByReferenceTestMethod(System.ArgumentNullException exception, ref string referenceArgument) 
{ 
    referenceArgument = string.Format("referenceArgument{0}", exception.Message); 
    return true; 
} 

collectionplan.xml例解決されたマーカーのないLongDescriptionを表示し、I chメッセージ自体がまったく表示されない順序を設定します。

私は理解しているので、メソッドが戻るまでイベントが評価されないため、onResult = "true"のときにrefが表示されるはずです。 onResult = "false"データクエリで同じ引数を使用すると、メソッドによって値が設定される前に評価されます。

私は間違っていますか?

答えて

1

私が知る限り、あなたが望むことはできません。過去に数回同じことをやろうとしたが、うまくいかなかった。ただし、問題はrefパラメータではありません。また、「通常の」パラメータでは機能しません。

onReturn="true"を使用すると、メソッドから返された値、つまりindex="-1"のみを参照できます。この場合、パラメータの値を読み取ることはできません。これは、IntelliTraceがどのように動作するのかに原因があり、回避策がわかりません。

プログラマブルなデータクエリも役立ちません。最初のものは、入力パラメータ(onReturn="false")および戻り値を分析する第1(onReturn="false")を分析するために呼び出される

  • object[] EntryQuery(object thisArg, object[] args)
  • object[] ExitQuery(object returnValue)

:PDQは、実施の2つのメソッドを有しています。繰り返しますが、ExitQueryでは戻り値にしかアクセスできません。

関連する問題