Why do I get the error “The target GatherAllFilesT

2019-01-16 09:25发布

I have recently installed the new Azure development tools for Visual Studio 2010 service pack 1. Every time that I try to publish an existing website (using file system deployment) I get the following error:

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

Can anyone tell me what I am missing?

Thanks

18条回答
不美不萌又怎样
2楼-- · 2019-01-16 10:11

If editing in VS2012 (Visual Studio 2012) a VS2010 project try this. Edit the csproj file from:

<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" />
查看更多
beautiful°
3楼-- · 2019-01-16 10:12

Guys I'm terribly sorry you are running into this issue.

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:

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

查看更多
老娘就宠你
4楼-- · 2019-01-16 10:12

I have the same issue in VS2013, the solution I found was by creating a new empty web application project can copying the following lines from it into my old website project: At the top:

<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" />
查看更多
戒情不戒烟
5楼-- · 2019-01-16 10:14

Removing these installations solved the issue for me:

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

Reference

查看更多
霸刀☆藐视天下
6楼-- · 2019-01-16 10:17

I realize this in an old question, but I ran into it recently and here is how I solved it.

Background: I had an old project that I upgraded to VS studio 13. It looks like the project file wasn't upgraded properly.

There are references 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 a "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" />

This is what I changed it into:

<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 publishing to the filesystem works!

查看更多
该账号已被封号
7楼-- · 2019-01-16 10:19

Same issue I have Fixed. Please check if some files are missing into solution. if you are facing error like Error - The target "GatherAllFilesToPublish" does not exist in the project. Then just open .proj file and delete this line <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

You get actual error or those missing files into solution

查看更多
登录 后发表回答