title: Visual Studio 2019 and Visual Studio 2012 different behaviour for the same code using the same C# version
body: <p>This code runs on Visual Studio 2019 but fails to compile on Visual Studio 2012</p>
  <pre class="lang-cs prettyprint-override"><code>Task.Factory.StartNew(HandleMessages);
  </code></pre>
  <pre class="lang-cs prettyprint-override"><code>public async Task HandleMessages()
  {
     ...
  }
  </code></pre>
  <p>Visual Studio 2012 shows this error</p>
  <blockquote>
  <p>The call is ambiguous between the following methods or properties: 'System.Threading.Tasks.TaskFactory.StartNew(System.Action)' and 'System.Threading.Tasks.TaskFactory.StartNew&lt;System.Threading.Tasks.Task&gt;(System.Func&lt;System.Threading.Tasks.Task&gt;)'</p>
  </blockquote>
  <p>I can fix this error like this :</p>
  <pre class="lang-cs prettyprint-override"><code>Task.Factory.StartNew&lt;Task&gt;(HandleMessages);
  </code></pre>
  <p>But I can't understand why does Visual Studio 2019 compile it without showing any error while Visual Studio 2012 rejects it.</p>
  <p>I'm building an application using the following:</p>
  <ul>
  <li>Visual Studio Community 2019</li>
  <li>WinForms</li>
  <li>C# 5.0</li>
  <li>.Net Framework 4.5</li>
  </ul>
  <p>I have the same setup for the Visual Studio 2012</p>
  <p>Tried building the solution using MSBuild it shows the same error that Visual Studio 2012 does.</p>
  <p><strong>I need to know why does Visual Studio 2019 accepts this code and if there is a way to make it behave the same way Visual Studio 2012 does.</strong></p>