0

I'm unable to run a simple Console application in Visual Studio 15 Preview 3. I used Console Application project template under Visual C# -> Windows. It fails with following error:

1>C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018: The "GetFrameworkPath" task failed unexpectedly.
1>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>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>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>C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at Microsoft.Build.Tasks.GetFrameworkPath.<>c.<.cctor>b__0_5()
1>C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at System.Lazy`1.CreateValue()
1>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>C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at System.Lazy`1.get_Value()
1>C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3389,7): error MSB4018:    at Microsoft.Build.Tasks.GetFrameworkPath.get_FrameworkVersion40Path()
1>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.

Here is my App.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
</configuration>

I've not added any new references, nuget packages or code in the default template boiler plate code. I've already taken following steps:

  1. Restart Visual Studio
  2. Clean solution
  3. Running Visual Studio with administrator privileges

Please help if anyone has faced similar issue.

I saw similar issue being logged on Visual Studio community site but no one has responded - https://community.visualstudio.com/problems/55/error-msb4018-the-getframeworkpath-task-failed-une.html

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
RBT
  • 24,161
  • 21
  • 159
  • 240

0 Answers0