手頭一個vs2010升級到vs2012后,web項目發布到本地目錄時項目報錯:“該項目中不存在目標“GatherAllFilesToPublish””
通過谷歌大神的幫助,找到了解決方法。共享之。
原文如下:If you happen to encounter the following error “The target “GatherAllFilesToPublish” does not exist in the project.” while publishing your project to local filesystem after upgrading Visual Studio 2010 projects to Visual Studio 2012, it is most likely an issue due to the upgrade process.

Error: The target “GatherAllFilesToPublish” does not exist in the project.
While in TFS environment, a comparison is made between the csproj files. It seems that the following missing lines caused the issue:
By adding back the following lines before this line will eventually solve the issue. <ImportProject="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Solution:
- Right click project –> Unload Project. It will show the project as unavailable.
- Right click project again, this time select Edit (project name).csproj.
- Look for <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- Add the following above the line.
- End result:
- Save and Reload project.Issue should be solved.