Why am I getting the error "The target GatherAllFilesToPublish does not exist"?

I recently installed new Azure development tools for Visual Studio 2010 Service Pack 1. Each time I try to publish an existing website (using file system deployment), I get the following error:

The project target "GatherAllFilesToPublish" does not exist in the project.

Can someone tell me what I am missing?

thank

+63
azure visual-studio-2010-sp1
Jun 12 2018-12-12T00:
source share
15 answers

Guys I'm sorry that you ran into this problem.

I think I know what the problem is. When you install the Azure SDK bits, it installs some VS Web Publish updates. One of them updates the file in C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ WebApplications \ Microsoft.WebApplication.targets. Based on how our installation is determined, if this file has an updated timestamp (for some reason), then when the new component is installed, the file is not updated.

To solve this problem, you must follow these steps:

Can you try and let me know if this works or not?

+81
Jun 22 '12 at 21:28
source share

I had this problem and it was fixed by adding:

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

to the project file. I still don’t know what is going on.

+43
Jan 31 '14 at 10:46
source share

This worked for me fix - collect all files to post error message

  • Right-click the project and select Modify (project name) .csproj. (e.g. edit in notepad)
  • Look for <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • Add the line above.

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

+41
Feb 26 '14 at 22:49
source share

Removing these settings solved the problem for me:

  • Microsoft Web Publish - Visual Web Developer Express 2010
  • Microsoft Web Publish - Visual Studio 2010

Link

+10
Jul 03 '12 at 19:34
source share

I had a similar problem when I wanted to publish an ASP.Net application for Windows Azure. After many trial and error, finally, this solution worked for me. It does not require renaming files or any installation / reinstallation of patches / patches. Here is what you need to do:

Open your ASP.Net project file (.csproj) in Wordpad / Notepad and find a line that looks something like this:

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

Replace it with the line as shown below:

 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> 
+5
Sep 26 '13 at 4:49 on
source share

I had a similar problem and resolved it using the steps provided by Sayed.

The renamed file was in the v10.0 directory.

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

The original file that was there was dated January 18, 2011, after renaming it with the extension .bak, and then reinstalling KB2591016, the publication seems to be working again. The new Microsoft.WebApplication.targets file date is now August 11, 2011.

+3
Jun 25 2018-12-12T00:
source share

I understand this in the old question, but I recently ran into it, and this is how I solved it.

Background: I had an old project, which I upgraded to VS studio 13. It looks like the project file was not updated properly.

There are links to VS v10.0 in the csproj file, but I am running VS 13, which is really "v12.0".

So, I told the csproj file to use the "v12.0" folder, not the "v10.0" folder.

This is what I had:

 <PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> </PropertyGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(SolutionDir)\..\BuildTools\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(SolutionDir)\..\BuildTools\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> 

Here is what I changed:

 <PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> </PropertyGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> 

Now my file system publication is working!

+3
Sep 10 '15 at 8:30
source share

I struggled with the same issue with Visual Studio 2013 (and 2015).

An important decision for me was to add a VSToolsPath property VSToolsPath that is missing from my project file, for some reason.

I added this to the <PropertyGroup> directive:

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

As a side note: My project file also references the version of Microsoft.WebApplication.targets file version 10.0, but everything seems to be fine.

+3
Dec 17 '15 at 10:12
source share

I had the same error. Somehow this line was missing.

 <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> 

Added it a little lower.

 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 

Works great now

+2
Jul 25 '14 at 12:07
source share

I have the same problem in VS2013, the solution I found was by creating a new empty web application project that can copy the following lines from it to my old website project: Above:

 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> </PropertyGroup> <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" /> 
+2
Mar 10 '15 at 12:48
source share

The said solution did not work in my project, which was updated using VS2012. But this one worked

+1
Sep 12 '13 at 4:29
source share

When editing in VS2012 (Visual Studio 2012), the VS2010 project will try this. Edit the csproj file:

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

And change to:

 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" /> 
+1
Mar 10 '14 at 22:55
source share

Right-click the project and select Modify (project name) .csproj. (e.g. edit in notepad) Search Add the line above.

$ 13.0 (MSBuildExtensionsPath32) \ Microsoft \ VisualStudio \ V $ (VisualStudioVersion) Save and reload the project.

It really works for me, thanks

+1
Dec 23 '15 at 11:11
source share

Since the problem cannot be reproduced on my side, I would suggest that you try reinstalling the SDK.

Before installing a new one, try to completely remove the old SDK.

Regards,

Ming Xu.

0
Jun 12. 2018-12-12T00:
source share

For Visual Studio 2017 - it should be added after the block in the .csproj file, use notepad and search for ".targets" to find it ...

I created a new VS 2017 project and this works for me (without warning):

  <PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> </PropertyGroup> <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" /> <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" /> </Target> 
0
Sep 14 '17 at 6:57
source share



All Articles