title: Can't use DateTime in simple c# program
body: <p>I have this really simple code in Microsoft Visual Studio C# 2013:</p>
  
  <pre><code>//all stuff I include
  using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.Data.SqlClient; //sql DB
  using System.Media; //media player
  using System.IO; //required for exceptions
  using System.Globalization;
  
  //start
  namespace Programx
  {
      public partial class Form1 : Form
      {
  
          public Form1()
          {
              InitializeComponent();
              MessageBox.Show(DateTime.Now.ToString("MMMM yyyy")); // this give error (or any other code that has DateTime)
          }
  }
  //-----
  </code></pre>
  
  <p>and I get this error in error list:
  "Error  1   The name 'dateTime' does not exist in the current context"</p>
  
  <p>I have found 2 possible answear to the problem:</p>
  
  <ol>
  <li>lack of: <code>using System.Globalization;</code> (but I have it in code)</li>
  <li><code>mscorlib.dll</code> - included by defualt (I did not change it) but possible cause of the problem</li>
  </ol>
  
  <p>Now I have checked my settings in <code>MS Studio 2013</code>
  project -> Properties -> Build -> Advanced..." and  I'd not chave mentioned option <code>"Do not reference mscorlib.dll"</code> or <code>"Do not use stdlib"</code> or anything similar. (but its only a suspect, I have no proof this is the reason)</p>
  
  <p>Could somebody tell me what I need to do in order to use <code>DateTime</code>? Thx.</p>
  
  <hr>
  
  <p>EDIT1:</p>
  
  <p>Answear (from my comment):<br>
  This is really strange to me, as I said I'm new to c#. Problem is gone, and there was nothing wrong with codes/settings. I changed nothing - just I turned off Visual studio and restarted my pc - that is it, and suprise :), it works.   </p>
  
  <p>I hope this helps somebody, becouse I spend couple hours figurying out what the problem is. Thank you very much,to everyone who tried to help me - I will put this as answear if the question will leave [on hold] status.</p>
  
  <p>EDIT2:  </p>
  
  <p>I had the same problem next day with another variable (that had nothing to do with DateTime). Again, shutting MS Visual studio fixed the problem. I hope this helps somebody.</p>
  
  <p>Could anybody explain? I suspect that Visual cleans something after rebot.</p>