I have a self-hosted WCF service and I’m trying to enable performance counters, so I have added this to the web.config file :
<system.serviceModel>
<diagnostics performanceCounters="All" />
...
After running my service and making sure that it is running, I then open perfmon.exe and try to add the performance counters. However there’s nothing shown in the “Instances of selected object” box.
my app.config:
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
</listeners>
</source>
</sources>
</system.diagnostics>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.serviceModel>
<diagnostics wmiProviderEnabled="true" performanceCounters="All">
<messageLogging logMalformedMessages="false" logMessagesAtServiceLevel="false"
logMessagesAtTransportLevel="false" />
</diagnostics>
<bindings>
<ws2007HttpBinding>
<binding name="soapBinding" maxReceivedMessageSize="1073741824">
<readerQuotas maxStringContentLength="1073741824" maxArrayLength="1073741824" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</ws2007HttpBinding>
</bindings>
<services>
<service behaviorConfiguration="defaultBehavior" name="SoapService">
<endpoint address="http://localhost/SoapService/"
binding="ws2007HttpBinding" bindingConfiguration="soapBinding" name=""
contract="ISoapService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost/SoapService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="defaultBehavior">
<serviceAuthorization impersonateCallerForAllOperations="false" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Why does perfmon not show up any instances running?
btw, if the app.config doesn’t highlight for you running .NET v4
Don’t know if it is still valid but let me try an answer.
There are many things you should check :