How can I configure WCF activity propagation without a config file?

I have my own WCF service that uses activity IDs for logging purposes. I want the service activity id to match what is set on the client. This is the property I'm using in my service method to get the client activity id:

Trace.CorrelationManager.ActivityId

      

This is the configuration I have for both the service and the client:

<system.diagnostics>
  <sources>
    <source name="System.ServiceModel" ... propagateActivity="true">
...
  </sources>
</system.diagnostics>

      

Trace.CorrelationManager.ActivityId

Returns an empty GUID without this configuration .

How can I accomplish the same thing without config i.e. completely in C #? I have access to the service and client code. Is there a parameter somewhere that can be set to enable activity propagation through WCF?

+3


source to share





All Articles