У меня есть собственная служба WCF, и я пытаюсь включить счетчики производительности, поэтому я добавил это в файл web.config:
<system.serviceModel>
<diagnostics performanceCounters="All" />
...
После запуска службы и проверки ее работоспособности я открываю perfmon.exe и пытаюсь добавить счетчики производительности. Однако в поле «Экземпляры выделенного объекта» ничего не отображается.
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>
Почему perfmon не показывает запущенные экземпляры?
кстати, если app.config не подсвечивается для вас, работающего .NET v4