What should you do?

A Windows Communication Foundation (WCF) service is hosted in Microsoft Internet Information Services (IIS).
You are preparing the configuration file for production deployment. You need to set up tracing so that an administrator can adjust
the System.ServiceModel trace level without causing the ASP.NET host application domain to restart.
You need to ensure that tracing is turned off by default. What should you do?

A Windows Communication Foundation (WCF) service is hosted in Microsoft Internet Information Services (IIS).
You are preparing the configuration file for production deployment. You need to set up tracing so that an administrator can adjust
the System.ServiceModel trace level without causing the ASP.NET host application domain to restart.
You need to ensure that tracing is turned off by default. What should you do?

A.
Add the following element to the system.serviceModel configuration section:
<diagnostics wmiProviderEnabled=”true” />
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”Off”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>

B.
Add the following element to the system.serviceModel configuration section:
<diagnostics etwProviderId=”{7799e76e-0f8b-407a-a616-3f91ba6072b9}”>
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”Off”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>

C.
Add the following element to the system.serviceModel configuration section:
<serviceBehaviors>
<behavior>
<serviceDebug/>
</behavior>
</serviceBehaviors>
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”ActivityTracing”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>

D.
Add the following element to the system.serviceModel configuration section:
<serviceBehaviors>
<behavior>
<serviceDebug/>
</behavior>
</serviceBehaviors>
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”Off”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>

Explanation:
Enabling WMI

A WMI provider is a component that exposes instrumentation at runtime through a WBEM-compatible interface.
It consists of a set of WMI objects that have attribute/value pairs. Pairs can be of a number of simple types.
Management tools can connect to the services through the interface at runtime.
WCF exposes attributes of services such as addresses, bindings, behaviors, and listeners.

The built-in WMI provider can be activated in the configuration file of the application.
This is done through the wmiProviderEnabled attribute of the <diagnostics> Element in the system.ServiceModel element section,
as shown in the following sample configuration.

<system.serviceModel>

<diagnostics wmiProviderEnabled=”true” />

</system.serviceModel>

This configuration entry exposes a WMI interface. Management applications can now connect through this interface and access
the management instrumentation of the application.

Using Windows Management Instrumentation for Diagnostics
(http://msdn.microsoft.com/en-us/library/ms735120(v=vs.90).aspx)



Leave a Reply 1

Your email address will not be published. Required fields are marked *