The target GatherAllFilesToPublish does not exist RRS feed

  • Question

  • User-2083583045 posted


      I have a web application built in VS 2010.  When I try to publish it to a file location with VS 2012, I get the error "The target GatherAllFilesToPublish does not exist".  I read the other similar thread, but it for VS 2010.  Does anyone know why this is happening and what to do about it?



    Wednesday, August 29, 2012 9:43 AM

All replies

  • User-2083583045 posted

    Thanks for the response.  I have tried those solutions.  None of them worked; or they don't apply.  I don't have Azure or Microsoft Web Publish installed.  Additional note, if I build a new Web Application with VS 2012, there is no problem on the Publish to file location; only when a web application developed with VS 2010 is opened with VS 2012, then attempt to Publish using VS 2012.  I have repaired the VS 2012 installation.   Any other ideas?

    Wednesday, August 29, 2012 10:07 AM
  • User-2083583045 posted


    referencing a post at http://sedodream.com/default.aspx in the blog published on Aug. 19, 2012, changed my .csproj file as suggested.  I received an "Invalid characters in XML".  Then I changed the original

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


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

    as GatherAllFilesToPublish is defined in the second .targets file.  When I reloaded the application in VS2012, the correct changes described in the sedodream.com site were automagically implemented in a slightly different form.  It appears the correct changes were not implemented the first time I opened the VS2010 project in VS2012. 

    Wednesday, August 29, 2012 4:55 PM
  • User-40723237 posted

    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.

        <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

    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" />

    Friday, February 7, 2014 3:23 AM
  • User1907490511 posted

    Thank You, it works!

    Tuesday, August 19, 2014 6:14 AM
  • User-1153549114 posted

    That solved my problem, thanks!

    Wednesday, March 29, 2017 11:10 AM