title: c# override ToString of MyList<T> not shown in VS
body: <p>I want to have a class derived from <code>List&lt;T&gt;</code>, mainly for the purpose to be able to be shown different stuff than the usual <code>Count = 3</code> in the debugger of VisualStudio 2012. I thought this would be easy by providing my own overriden ToString() method for my own overriden generic <code>MyList&lt;T&gt;</code> class. </p>
  
  <p>It doesn't work though, the overriden ToString() is not called from the debugger and I still get to see the old Count = 3. </p>
  
  <p>Here is the code. </p>
  
  <pre><code>using System; 
  using System.Collections.Generic;
  
  namespace ConsoleApplication1 {
      public class MyList&lt;T&gt; : List&lt;T&gt;
      {
          public override string ToString()
          {
              int nMax = 100;
              string s = "N:" + this.Count + "; ";
              for (int i = 0; i &lt; this.Count &amp;&amp; s.Length &lt; nMax; ++i)
                  s += this[i].ToString() + "; ";
              return s;
          }
      }
  
  
      class Program
      {
          static void Main(string[] args)
          {
              MyList&lt;string&gt; a = new MyList&lt;string&gt; { "a", "b", "c" };
              Console.WriteLine(a.ToString());
          }
      } 
  }
  </code></pre>
  
  <p>When setting a breakpoint onto the last brace of the Main method, I get to see in the debugger Auto- or Local-window this:
    <code>a  | Count = 3 |  ConsoleApplication1.MyList&lt;string&gt;</code>  </p>
  
  <p>I want and expected to be shown there: 
    <code>a  | N:3; a; b; c; |  ConsoleApplication1.MyList&lt;string&gt;</code>  </p>
  
  <p>In the console window it is written <code>N:3; a; b; c;</code>, which shows that the method and the overriding in principle do work. Also, calling a.ToString() in the Direct-Window shows the expected <code>N:3; a; b; c;</code>.</p>
  
  <p>What am I missing?   How can I solve my problem?</p>