.net WCF服务实例未在perfmon中显示

.net WCF服务实例未在perfmon中显示,.net,wcf,performancecounter,.net,Wcf,Performancecounter,我有一个自托管的WCF服务,我正在尝试启用性能计数器,因此我已将其添加到web.config文件中: <system.serviceModel> <diagnostics performanceCounters="All" /> ... ... 运行服务并确保其正在运行后,我打开perfmon.exe并尝试添加性能计数器。但是,“选定对象的实例”框中没有显示任何内容 我的app.config: <?xml version="1.0"?> <

我有一个自托管的WCF服务,我正在尝试启用性能计数器,因此我已将其添加到web.config文件中:

<system.serviceModel>
  <diagnostics performanceCounters="All" />
  ...

...
运行服务并确保其正在运行后,我打开perfmon.exe并尝试添加性能计数器。但是,“选定对象的实例”框中没有显示任何内容

我的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不显示任何正在运行的实例


顺便说一句,如果运行.NET v4时app.config没有突出显示,我不知道它是否仍然有效,但让我尝试一个答案

有很多事情你应该检查:

  • 您的目标是.NET4。某些计数器将位于ServiceModelXXX 4.0.0.0中
  • 有时,您需要重新安装WCF计数器。访问此命令行
  • 计数器实例在第一次调用之前不存在(如果不使用appfabric autostart)
  • 您的帐户应具有所需的权限:性能监视器/日志用户

    • 不知道它是否仍然有效,但让我试试答案

      有很多事情你应该检查:

      • 您的目标是.NET4。某些计数器将位于ServiceModelXXX 4.0.0.0中
      • 有时,您需要重新安装WCF计数器。访问此命令行
      • 计数器实例在第一次调用之前不存在(如果不使用appfabric autostart)
      • 您的帐户应具有所需的权限:性能监视器/日志用户