Can't build in visual studio 2015 because 'Microsoft.Build.Tasks.v14.0.dll' cannot be found

前端 未结 11 697
青春惊慌失措
青春惊慌失措 2020-12-28 11:25

When attempting to build in visual studio 2015, the following file is missing? This project was previously being built in VS2013.

Severity Code De

相关标签:
11条回答
  • 2020-12-28 12:17

    In my case, I removed "ls.pubignore.wpp.targets" file from root. and It removed the error. :)

    0 讨论(0)
  • 2020-12-28 12:21

    For Visual Studio 2017 this is what worked for me, it's a mix of two provided solutions. Neither worked on their own so this is why I'm submitting this as a new answer.

    In the file C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\CodeAnalysis\Microsoft.CodeAnalysis.Targets

    Replace AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll"> with AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">

    And then copy the file C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.Tasks.Core.dll in the same folder with the name Microsoft.Build.Tasks.v15.0.dll

    0 讨论(0)
  • 2020-12-28 12:23

    My solution: removing two rows from the "*.csproj" file:

    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
    <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
    
    0 讨论(0)
  • 2020-12-28 12:23

    I had the same issue, in my case I updated some of the packages from NuGet package manager in VS2015, then tried to open the same solution in vs2013 in another machine where vs2015 was not installed.

    Installing Microsoft Build Tools 2015 has resolved the error. That adds Microsoft.Build.Utilities.Core.dll to the GAC, which I think is what makes it work.

    https://www.microsoft.com/en-in/download/details.aspx?id=48159

    0 讨论(0)
  • 2020-12-28 12:25

    It was enough for me to just restart Visual Studio.

    I suspect that I had earlier killed all my MSBuild.exe processes doing something else and that not having any MSBuild.exe processes causes the error.

    0 讨论(0)
提交回复
热议问题