title: Struct and class display value in Visual Studio debug mode
body: <p>Consider the following simple program (using Visual Studio 2015):</p>
  
  <pre><code>public class Program
  {
      public static void Main(string[] args)
      {
          var dtClass = new MyDateTimeWrapperClass(DateTime.Today);
          var dtStruct = new MyDateTimeWrapperStruct(DateTime.Today);
          WriteLine(dtClass);
          WriteLine(dtStruct);
          ReadKey();
      }
  }
  
  public class MyDateTimeWrapperClass
  {
      private readonly DateTime _value;
  
      public MyDateTimeWrapperClass(DateTime value)
      {
          _value = value;
      }
  
      public override string ToString() =&gt; _value.ToString(&quot;MM/dd/yyyy&quot;);
  }
  
  public struct MyDateTimeWrapperStruct
  {
      private readonly DateTime _value;
  
      public MyDateTimeWrapperStruct(DateTime value)
      {
          _value = value;
      }
  
      public override string ToString() =&gt; _value.ToString(&quot;MM/dd/yyyy&quot;);
  }
  </code></pre>
  <p>The console will report the expected output of the <code>ToString</code> method. <strong>However, when in debug mode the output is not the same.</strong></p>
  <p><a href="https://i.stack.imgur.com/L1fMX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L1fMX.jpg" alt="enter image description here" /></a></p>
  <p>I had always thought that Visual Studio used a <code>ToString()</code> call to display this value. Yet with structs this appears to not be the case. Could someone explain this behavior? I would appreciate answers which also describe how this value is computed in the first place, as it seems my understanding is incomplete.</p>
  <h1>Update: Additional Information</h1>
  <ol>
  <li>This issue does not happen when I use Visual Studio 2013.</li>
  <li>Hardcoding the <code>ToString</code> calls to different values results in normal behavior.</li>
  </ol>