The target "GatherAllFilesToPublish" does not exist in the project.
Sunday, June 28, 2020 Category : ASP.NET, ASP.NET MVC 0
I fixed the issue by doing following modifications to the Project file. have VS 2012 and the web application was MVC 4
1. Unload the project and start editing the csproj file.
2. Added following lines.
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' ==
''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
3. Added following lines.(Note that some of the Import statments may already exisits. In such case you do not need to add them.
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import
Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"
Condition="false" />
Source : https://forums.asp.net/t/1838524.aspx?The+target+GatherAllFilesToPublish+does+not+exist
Answer by : dilanh