Home > front end >  MSB4057: The target "pipelinePreDeployCopyAllFilesToOneFolder" does not exist in the proje
MSB4057: The target "pipelinePreDeployCopyAllFilesToOneFolder" does not exist in the proje

Time:08-12

New developer here. I pushed my code to GitHub and then tried to build and deploy it but received this error.

Error:

D:\a\Deploy\Deploy\SimpleInventory\SimpleInventory.csproj : error MSB4057: The target "pipelinePreDeployCopyAllFilesToOneFolder" does not exist in the project.
Error: Process completed with exit code 1.

CodePudding user response:

You can follow the below workarounds to resolve this issue:

  • Check whether your application .csproj file has the multiple lines for building like below:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v.*.*\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '*.*'" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v*.*\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '*.*'" />

If you have found the multiple lines then try to remove condition from above lines as shown below:

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

Or alternatively,

Go to this file location Microsoft.Web.Publishing.targets file

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v.*\Web\Microsoft.Web.Publishing.targets

and include the below code to your MSBuild/.csproj file,

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v.*\Web\Microsoft.Web.Publishing.targets" />
  • Related