Error: The Target "GatherAllFilesToPublish" does not exist in the project, but is in v10.5 folder

scott-pascoe picture scott-pascoe · Dec 24, 2012 · Viewed 7.9k times · Source

I've been going around and around on this issue. I've got a ASP.NET MVC 3 Web application built in VS2010 SP1. When I attempt to Publish to the local file system, I get the error

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

and it fails. I've followed the answer described in Why do I get the error "The target GatherAllFilesToPublish does not exist"? but it doesn't resolve my problem.

I've installed the Azure SDK 1.8 for VS2010 (October 2012), trying to get my system back to working. With this install, I see the following files/folders in my MSBuild tree.

Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Targets, dated 1/18/2011.

This file does not mention the "GatherAllFilesToPublish"

After installing the Azure SDK, I've got another file/folder:

Microsoft\VisualStudio\v10.5\Web\Microsoft.Web.Publishing.Targets, dated 9/27/2012.

This file does contain the "GatherAllFilesToPublish" target.

Apparently my Publish function in VS2010 isn't using the v10.5 folder's targets. Does anyone have any suggestions to resolve this problem?

Thanks,

Answer

scott-pascoe picture scott-pascoe · Dec 24, 2012

And the answer is...

At some point in the past, the project had been edited to include a local copy of the msbuild folder and I had forgotten about it. I used sysinternals' procmon to find the file access and it was only referencing msbuild under my project.

With that, i renamed the folder, edited the csproj file to remove the localized references for the MSBuildExtensionsPath32, and reloaded the project.

I was able to successfully publish my app.