Why do I get the error "The target GatherAllFilesToPublish does not exist"?

I think that I know what the issue is. When you install the Azure SDK bits it installs some VS Web Publish updates. One of these updates the file at

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets

Based on how our setup is defined if that file has an updated timestamp (for whatever reason) then when you install the new component the file does not get updated.

To resolve this you should be able to follow the steps below:

  • Rename the Microsoft.WebApplication.targets to Microsoft.WebApplication.targets.bak
  • Install/Repair using the exe at http://go.microsoft.com/fwlink/?LinkId=253458

I had this problem, and it was fixed by adding:

<Target Name="GatherAllFilesToPublish">
</Target>

to the Project File.


This worked for me fix - gather all files to publish error

  1. Right click the project and select Edit (project name).csproj. (e.g. Edit in notepad)
  2. Look for <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  3. Add the following above the line.

    <PropertyGroup> 
     <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">13.0</VisualStudioVersion>
     <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
    </PropertyGroup>
    
  4. Save and Reload project.