title: Can I add extension methods to an existing static class?
body: <p>I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as <code>Console</code>.</p>
  <p>For example, if I want to add an extension to <code>Console</code>, called '<code>WriteBlueLine</code>', so that I can go:</p>
  <pre><code>Console.WriteBlueLine(&quot;This text is blue&quot;);
  </code></pre>
  <p>I tried this by adding a local, public static method, with <code>Console</code> as a '<code>this</code>' parameter... but no dice!</p>
  <pre><code>public static class Helpers {
      public static void WriteBlueLine(this Console c, string text)
      {
          Console.ForegroundColor = ConsoleColor.Blue;
          Console.WriteLine(text);
          Console.ResetColor();
      }
  }
  </code></pre>
  <p>This didn't add a '<code>WriteBlueLine</code>' method to <code>Console</code>... am I doing it wrong? Or asking for the impossible?</p>