Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The target "GatherAllFilesToPublish" does not exist in the project

I've checked that the same error occurred in the past with earlier vs .net versions but I am facing this issue in VS 2017 while trying to upgrade from VS Community 15.3.5 to 15.4.

  • I first installed using the web installer by choosing the options,
  • some how there were a couple of errors & the download + installation took over 9+ hours

visual studio was working and compiling project except that this had the problem 'The target "GatherAllFilesToPublish" does not exist in the project'.

Then I tried downloading the entire setup using "vs_community.exe --layout "C:\MyFolder" --lang en-US" which again took over 9 hours to finish download. Re-ran the setup choosing Repair, again the same issue.

Is any one aware of a quicker way to solve this above problem?

like image 811
Muthu Avatar asked Oct 19 '17 14:10

Muthu


2 Answers

I had same issue (Visual Studio 2017). Install - " MSBuild.Microsoft.VisualStudio.Web.targets " nuget package to visual studio. And then try to publish.

like image 183
Jain Avatar answered Oct 30 '22 17:10

Jain


I had similar problem and it solved by changing csproj file:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

changed to

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" Condition="true" />
like image 37
Mohammad Reza Sadreddini Avatar answered Oct 30 '22 19:10

Mohammad Reza Sadreddini