title: SMTP Client gives the errror 'Instance names used for writing to custom counters must be 127 characters or less'
body: <p>I'm getting a strange error trying to send an email a c# .NET 3.5 winforms application. When I start a new SMTPClient like this:</p>
  
  <pre><code>using System.Net;
  using System.Net.Mail;
  
  SmtpClient client = new SmtpClient();
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>System.InvalidOperationException occurred
     Message=Instance names used for writing to custom counters must be 127 characters or less. 
     Source=System
     StackTrace:
           at System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String counterName, String instanceName, PerformanceCounterInstanceLifetime lifetime)
     InnerException: </p>
  </blockquote>
  
  <p>I get the same line no matter how I start the new SMTPClient, e.g. </p>
  
  <p><code>SmtpClient client = new SmtpClient("smtp.gmail.com", 587);</code></p>
  
  <p>I read that this might have to do with a long directory structure but I can't change that. I also read it might be to do with unit testing, but I'm not doing any kind of unit testing.</p>
  
  <p>Is there a way to fix this?</p>