手头一个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. 25-socket

    socket通信流程 #server端 #family参数代表地址家族,可为AF_INET或AF_UNIX.AF_INET家族包括#Internet地址,AF_UNIX家族用于同一台机器上的进程间通信 ...

  2. Go语言标准库之time

    Go语言标准库之time 时间的格式化和解析 格式化 Format Go语言和其他语言的时间格式化的方式不同,Go语言格式化的方式更直观,其他的语言一般是yyyy-mm-dd package main ...

  3. spring boot 集成 thymeleaf

    例如meta标签,低版本标签必须要闭合,高版本不用这么严格. pom文件引入高版本jar包如下,propertis里添加:

  4. c++ vector的内存释放

    c++中vector的一个特点是: 内存空间只会增长,不会减小.即为了支持快速的随机访问,vector容器的元素以连续方式存放,每一个元素都挨着前一个元素存储.设想,如果每次vector添加一个新元素 ...

  5. js 判断 ip

    [使用新浪ip接口] 多地域测试方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=111.202.103.2 ...

  6. postgresql 获取修改列的值

    使用returning CREATE TABLE users (firstname text, lastname text, id serial primary key); INSERT INTO u ...

  7. C++模板的应用

    需求:类比数组类,只不过数组类型不再是整型.浮点型等,也可以是类. 1.创建模板类 头文件 #ifndef MYVECTOR_H #define MYVECTOR_H #include <ios ...

  8. kali linux安装中文输入法

    1.先安装VMware虚拟机,再安装kali linux ------------------------------------------------------------------ 2.安装 ...

  9. checkbox在vue中的用法总结

    前言 关于checkbox多选框是再常见不过的了,几乎很多地方都会用到,这两天在使用vue框架时需要用到checkbox多选功能,实在着实让我头疼,vue和原生checkbox用法不太一样, 之前对于 ...

  10. Linux中inotify软件部署及参数事件演示

    声明:博主使用的是CentOS6.9的系统 参考资料: https://github.com/rvoicilas/inotify-tools/wiki http://www.ibm.com/devel ...