zoukankan      html  css  js  c++  java
  • vs2012vs2013vs2015碰到生成时报该错误:项目中不存在目标“GatherAllFilesToPublish”

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

    错误 MSB4057: 该项目中不存在目标“GatherAllFilesToPublish”

    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:

    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.
    5. End result:
    6. Save and Reload project.Issue should be solved.
    7. 检查工程文件中是否存在如下情况:
    8. <PropertyGroup>
          <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
          <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)MicrosoftVisualStudiov$(VisualStudioVersion)</VSToolsPath>
        </PropertyGroup>
        <Import Project="$(MSBuildBinPath)Microsoft.CSharp.targets" />
        <Import Project="$(VSToolsPath)WebApplicationsMicrosoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '8.0'" />
        <Import Project="$(MSBuildExtensionsPath32)MicrosoftVisualStudiov10.0WebApplicationsMicrosoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '8.0'" />

      如果是,删除最下面两行,再发布就可以了。

    9. <Import Project="$(VSToolsPath)WebApplicationsMicrosoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '8.0'" />
        <Import Project="$(MSBuildExtensionsPath32)MicrosoftVisualStudiov10.0WebApplicationsMicrosoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '8.0'" />
  • 相关阅读:
    3 Steps to Perform SSH Login Without Password Using sshkeygen & sshcopyid
    排序算法java版,速度排行:冒泡排序、简单选择排序、直接插入排序、折半插入排序、希尔排序、堆排序、归并排序、快速排序
    Ubuntu 取消 Apache及MySQL等自启动
    linux screen 命令详解
    Ubuntu把家目录文件夹名称改为英文
    Ubuntu12.10 下 PPA安装搜狗输入法 for Linux
    VirtualBox虚拟机后台运行
    Ubuntu下安装jdk
    [整理篇]linux加入windows域之完美方案
    pxe 远程安装linux系统
  • 原文地址:https://www.cnblogs.com/zjoch/p/6278108.html
Copyright © 2011-2022 走看看