title: MSB4018: The "GetFrameworkPath" task failed unexpectedly
body: <p>I'm unable to run a simple Console application in Visual Studio 15 Preview 3. I used <code>Console Application</code> project template under <code>Visual C# -&gt; Windows</code>.  It fails with following error:</p>
  
  <pre><code>1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018: The "GetFrameworkPath" task failed unexpectedly.
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018: System.ArgumentException: Visual Studio version "4.0" is not supported.  Please specify a value from the enumeration Microsoft.Build.Utilities.VisualStudioVersion.
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at Microsoft.Build.Shared.ErrorUtilities.ThrowArgument(Exception innerException, String resourceName, Object[] args)
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at Microsoft.Build.Shared.FrameworkLocationHelper.GetVisualStudioSpec(Version version)
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at Microsoft.Build.Tasks.GetFrameworkPath.&lt;&gt;c.&lt;.cctor&gt;b__0_5()
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at System.Lazy`1.CreateValue()
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018: --- End of stack trace from previous location where exception was thrown ---
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at System.Lazy`1.get_Value()
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at Microsoft.Build.Tasks.GetFrameworkPath.get_FrameworkVersion40Path()
  1&gt;C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4028: The "GetFrameworkPath" task's outputs could not be retrieved from the "FrameworkVersion40Path" parameter. Visual Studio version "4.0" is not supported.  Please specify a value from the enumeration Microsoft.Build.Utilities.VisualStudioVersion.
  </code></pre>
  
  <p>Here is my App.config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;startup&gt; 
          &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /&gt;
      &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I've not added any new references, nuget packages or code in the default template boiler plate code. I've already taken following steps:</p>
  
  <ol>
  <li>Restart Visual Studio</li>
  <li>Clean solution</li>
  <li>Running Visual Studio with administrator privileges</li>
  </ol>
  
  <p>Please help if anyone has faced similar issue.</p>
  
  <p>I saw similar issue being logged on Visual Studio community site but no one has responded - <a href="https://community.visualstudio.com/problems/55/error-msb4018-the-getframeworkpath-task-failed-une.html" rel="nofollow">https://community.visualstudio.com/problems/55/error-msb4018-the-getframeworkpath-task-failed-une.html</a></p>