Programing

"대상 GatherAllFilesToPublish가 존재하지 않습니다"라는 오류가 발생하는 이유는 무엇입니까?

lottogame 2020. 11. 3. 07:35
반응형

"대상 GatherAllFilesToPublish가 존재하지 않습니다"라는 오류가 발생하는 이유는 무엇입니까?


최근에 Visual Studio 2010 서비스 팩 1 용 새 Azure 개발 도구를 설치했습니다. 기존 웹 사이트를 게시하려고 할 때 (파일 시스템 배포 사용) 다음 오류가 발생합니다.

대상 "GatherAllFilesToPublish"가 프로젝트에 없습니다.

아무도 내가 뭘 놓치고 있는지 말해 줄 수 있습니까?

감사


여러분,이 문제를 겪게되어 정말 죄송합니다.

문제가 뭔지 안다고 생각합니다. Azure SDK 비트를 설치하면 일부 VS Web Publish 업데이트가 설치됩니다. 이 중 하나는 C : \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ WebApplications \ Microsoft.WebApplication.targets에서 파일을 업데이트합니다. 파일에 업데이트 된 타임 스탬프가있는 경우 (어떤 이유로 든) 설정이 정의 된 방식에 따라 새 구성 요소를 설치할 때 파일이 업데이트되지 않습니다.

이 문제를 해결하려면 아래 단계를 따르십시오.

시도해보고 작동하는지 알려주시겠습니까?


이 문제가 있었고 다음을 추가하여 수정되었습니다.

<Target Name="GatherAllFilesToPublish">
</Target>

프로젝트 파일에. 나는 아직도 무슨 일이 일어나고 있는지 전혀 모른다.


이것은 나를 위해 일했습니다. 모든 파일을 수집하여 오류를 게시하십시오.

  1. 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 편집 (프로젝트 이름) .csproj를 선택합니다. (예 : 메모장에서 편집)
  2. 찾다 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  3. 줄 위에 다음을 추가하십시오.

    <PropertyGroup> 
     <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">13.0</VisualStudioVersion>
     <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
    </PropertyGroup>
    
  4. 프로젝트를 저장하고 다시로드합니다.


이러한 설치를 제거하면 문제가 해결되었습니다.

  • Microsoft Web Publish-Visual Web Developer Express 2010
  • Microsoft 웹 게시-Visual Studio 2010

참고


ASP.Net 응용 프로그램을 Windows Azure에 게시하려고 할 때 비슷한 문제가 발생했습니다. 많은 시행 착오 끝에 마침내이 솔루션 저에게 효과적이었습니다. 파일 이름을 바꾸거나 핫픽스 / 패치를 설치 / 재설치 할 필요가 없습니다. 수행해야 할 작업은 다음과 같습니다.

워드 패드 / 메모장에서 ASP.Net 프로젝트 파일 (.csproj)을 열고 다음과 비슷한 줄을 찾습니다.

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '8.0'" />

아래 주어진 줄로 바꿉니다.

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

VS 2017 에서이 문제가 발생했으며 여기에 제안 된대로 csproj 파일을 수동으로 변경하려고 시도했지만 제안 된 수정 사항 중 어느 것도 저에게 효과가 없었습니다. 이 너겟 패키지를 보았습니다. 그것은 나를 위해 일했습니다.

MSBuild.Microsoft.VisualStudio.Web.targets


나는 오래된 질문에서 이것을 알고 있지만 최근에 그것을 만났고 여기에 내가 어떻게 해결했는지가 있습니다.

배경 : VS studio 13으로 업그레이드 한 오래된 프로젝트가 있습니다. 프로젝트 파일이 제대로 업그레이드되지 않은 것 같습니다.

csproj 파일에 VS v10.0에 대한 참조가 있지만 실제로 "v12.0"인 VS 13을 실행하고 있습니다.

그래서 csproj 파일에 "v10.0"폴더가 아닌 "v12.0"폴더를 사용하도록 지시했습니다.

이것이 내가 가진 것입니다.

<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" />

이것이 내가 그것을 변경 한 것입니다.

<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)' != ''" />

이제 파일 시스템에 대한 게시가 작동합니다!


비슷한 문제가 있었고 Sayed에서 제공하는 단계를 사용하여 해결했습니다.

The file I renamed was in the v10.0 directory though.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets.

The original file that was there was dated 18-Jan-2011, after renaming it with a .bak extensions then reinstalled KB2591016, publishing seems to be working again. The new date of the file Microsoft.WebApplication.targets is now 11-Aug-2011.


I've been struggling with the same problem with Visual Studio 2013 (and 2015).

The crucial fix for me was to add the VSToolsPath property setting, which was missing in my project file, for whatever reason.

I added this into the <PropertyGroup> directive:

<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

As a side note: My project file is also referencing the v10.0 version of the Microsoft.WebApplication.targets file, but that seems to be okay.


Same problem with VS2017. You can try this, it worked for me.

  1. Unload the project and Edit csproj file
  2. search the keyword "WebApplication.targets"

     <Import Project="...\WebApplications\Microsoft.WebApplication.targets" ... >
    

    COMMENT or REMOVE this line.(maybe two lines depending on "Condition")

  3. Save and Reload project

In this step, it will prompt you to install some package about 500M...

After that, reload project, then it works!

I guess I just miss some components when I install VS 2017.

Also I notice the MSBuild Path is quite different in VS2017, but maybe that's not related to the problem cuz it uses relative path in the csproj file..


I had the same error. Somehow this line was missing.

<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

Added it just below

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Works fine now


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" />

Right click the project and select Edit (project name).csproj. (e.g. Edit in notepad) Look for Add the following above the line.

13.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) Save and Reload project.

This really work for me, Thanks


For Visual Studio 2017 - it should be added after the block in the .csproj file, use notepad and look for ".targets" to locate it...

I created a new VS 2017 project and this is working for me (with no warnings):

  <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" />
  <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
    <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
  </Target>

Sayed's solution did not work in my project which was upgraded using VS2012. But this worked


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" />

Since the issue cannot be reproduced on my side, I would like to suggest you to try to reinstall the SDK.

Please try to remove the old SDK completely before installing the new one.

Best Regards,

Ming Xu.


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

참고URL : https://stackoverflow.com/questions/10989051/why-do-i-get-the-error-the-target-gatherallfilestopublish-does-not-exist

반응형