手头一个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:

 
1
2
3
4
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>

By adding back the following lines before this line will eventually solve the issue.  <ImportProject="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Solution:

  1. Right click project –> Unload Project. It will show the project as unavailable.
  2. Right click project again, this time select Edit (project name).csproj.
  3. Look for <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  4. Add the following above the line.
     
    1
    2
    3
    4
      <PropertyGroup>
        <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
      </PropertyGroup>
  5. End result:
     
    1
    2
    3
    4
    5
      <PropertyGroup>
        <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
      </PropertyGroup>
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
  6. Save and Reload project.Issue should be solved.

vs2012碰到生成时报该错误:项目中不存在目标“GatherAllFilesToPublish”的更多相关文章

  1. vs2012碰到生成时报该错误:项目中不存在目标 “XXXXXX”

    vs2012碰到生成时报该错误:项目中不存在目标 "XXXXXX" 首先打开project文件,找到 以下信息: <Import Project="$(MSBuil ...

  2. vs2012\vs2013\vs2015碰到生成时报该错误:项目中不存在目标“GatherAllFilesToPublish”

    手头一个vs2010升级到vs2012后,web项目发布到本地目录时项目报错:“该项目中不存在目标“GatherAllFilesToPublish”” 通过谷歌大神的帮助,找到了解决方法.共享之. 原 ...

  3. 该项目中不存在目标“GatherAllFilesToPublish”

    在项目发布的时候报了一个 该项目中不存在目标“GatherAllFilesToPublish”  的奇怪错误,查了之后,在报错的.csproj里面添加 <Target Name="Ga ...

  4. 【手记】解决VS发布asp.net项目报错“该项目中不存在目标GatherAllFilesToPublish”及后续问题

    办法在最后. 用VS2017打开一个以前用VS2010写的asp.net项目后,设置好发布选项(发布到文件夹),发布的时候报错如图: 搜索一番,找到的办法是: 在项目文件(xxx.csproj)中,在 ...

  5. 无法发布-旧项目发布时出现:该项目中不存在目标“GatherAllFilesToPublish”。

    在项目文件夹下面找到 xxxx.csproj 文件,使用 VisualStudio Code 打开(或者任意编辑器,VisualStudio 可能无法编辑) 将以下节点进行更改 <Import ...

  6. idel 中 生成 jar包 和项目中自己需要的包

    一.首先在自己的项目中创建一个类类中创建一个构造方法构造方法中传入一个字符串参数(这个字符串参数是为了传入路径) 在方法体内通过file类创建文件夹(换而言之就是项目中的包) 二 .就是对这个项目中的 ...

  7. 解决 error MSB4057: 该项目中不存在目标“_CopyWebApplication” 问题

    在使用MSBuild 编译项目的时候报错: 解决办法: 在Web项目中,使用Nuget添加引用  MSBuild.Microsoft.VisualStudio.Web.targets 即可.

  8. VS2012使用NUGet自动下载(还原)项目中使用的包

    一: 当签出完整项目后,在解决方案名称上点右键,选择"启用NuGet程序包还原". 二: 出现询问,当然要点是,当完成后,会发现在解决方案中,多出".nuget" ...

  9. NetCore +EFCore+SqlServer根据数据库生成实体类到项目中

    转载自:https://www.cnblogs.com/yangjinwang/p/9516988.html 1.点击“工具”->“NuGet包管理器”->“程序包管理器控制台” 分别安装 ...

随机推荐

  1. Testing - 软件测试知识梳理 - 测试模型

    珠玉在前,不再赘言. 软件测试模型 软件测试模型汇总

  2. 【DB2】Event monitor for locking

    Customer said, they got the following Errors in applications logs Caused by: financing.tools.hub.sha ...

  3. (转)Linux 系统设置 : dmesg 命令详解

    原文:https://blog.csdn.net/yexiangCSDN/article/details/80683246 https://www.cnblogs.com/duanxz/p/34770 ...

  4. oracle无法启动asm实例记录

    首先查看asm进程ps aux|grep asmasm进程没起进行下面操作su - gridsrvctl start asmexit查看ora进程ps aux|grep oraora进程没起进行下面操 ...

  5. 用RIPv2实现网络区域的互通

    1.动态路由的分类: DV协议:距离矢量协议 距离矢量:路由器只能够知道邻居路由的信息 LS协议:链路状态协议 链路状态:路由器能够知道所在协议内的所有信息 RIP协议的全程是:路由信息协议(DV协议 ...

  6. 从零开始学 Web 之 BOM(二)定时器

    大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...

  7. 带你了解CSRF和XSS(一)

    浏览器的同源策略限制了一些跨域行为,但仍有些特例(img.iframe.script标签)不受跨域限制,这就给XSS攻击创造了机会(这完全不是同源策略的锅,一定是程序员的锅). 在讲下面的内容前,还是 ...

  8. MONGODB(四)——DBObject与JavaBean转换

    一.DBObject 转为 JavaBean /** * 将实体Bean对象转换成DBObject * */ public static <T> DBObject beanToDBObje ...

  9. C# json反序列化 对象中嵌套数组 (转载)

    看图: 这里可以看到是二层嵌套!!使用C#如何实现?? 思路:使用list集合实现 → 建立类 → list集合 → 微软的   Newtonsoft.Json  (一款.NET中开源的Json序列化 ...

  10. PowerDesigner 修改Name ,Code 不变

    tools-> General   Options-> Dialog:Operation   Modes: 去掉 NameToCodeMirroring 前面的√