title: Performance Monitor .NET CLR Networking 4.0.0.0 Instance naming
body: <p>I'm trying to use a Performance Counter do determine how many bytes my application has sent or received. I followed the suggested solution found here: <a href="https://stackoverflow.com/questions/442409/c-bandwidth">Calculating Bandwidth</a>, but the instance of my application doesn’t show up in the “.NET CLR Networking” category. Exception message: </p>
  
  <blockquote>
    <p>"Instance 'ApplicationName[8824]' does not exist in the specified
    Category"</p>
  </blockquote>
  
  <p>(I have added <code>&lt;performanceCounters enabled="true"/&gt;</code> in my App.config and it still it cannot be found after some networking activities)</p>
  
  <p>So I started Performance Monitor so see the error with my own eyes. As expected, my application doesn't show up in the <em>.NET CLR Networking</em> category, but it can luckily be found in the <em>.NET CLR Networking 4.0.0.0</em> category.</p>
  
  <p>However, my problem is that I cannot figure out how instance name is generated. Here is the name of the instance I see in the Performance  Monitor: <code>ApplicationName.exe_p4952_r15_ad1</code>.</p>
  
  <p>So far I have figured out that the first parts must be made of <strong>ProcessName</strong> and <strong>PID</strong>, but I 
  have no clue what the last two (<strong>"r15"</strong> and <strong>"ad1"</strong>) pieces come from.</p>
  
  <p>Does somebody have a clue what the last two pieces could be?</p>
  
  <p>One solution would be to enumerate all the instances found in the “.NET CLR Networking 4.0.0.0” category and search for ApplicationName.exe_PID*, but would prefer to look for the correct name directly (if possible).  </p>