Adil G
Adil G

Reputation: 15

TFS build error: Web deployment task failed. Package file does not have a .zip file name extension

I am getting the following error when I am queuing a build in TFS 2017.

"Microsoft.Web.Publishing.targets 3009,5): Error : Web deployment task failed. (Package file 'C:\agent_work\3\s\TestApp\TestApp\release' does not have a .zip file name extension.)"

enter image description here

enter image description here

I am not sure why I am getting this error. I have hosted agent on the TFS server. I created the build definition according to this video:

www.youtube.com/watch?v=HjD4A-yeFTE

Does somebody have any idea? Appreciate your help!

Upvotes: 1

Views: 1597

Answers (1)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30392

Test at my side and everything works correctly. Please try below items to narrow down the issue:

  • Please check the drop folder, if the .zip file actually being in the place that you expected.
  • Try to specify the output path, eg: /p:PackageLocation="$(build.artifactstagingdirectory)\\" , then specify the Copy Root path as $(build.artifactstagingdirectory) in Copy and Publish Build Artifacts task.
  • Explicitly specifying .zip extension in MSBuild Argument in the Build Definition. p:PackageLocation="$(BuildConfiguration)\package.zip
  • Check the build log, check if MSbuild works correctly. Also you can try the Msbuild command line locally to check if the .zip package can be generated.
  • Deploy a new agent on your Develop machine, create a new build definition, then build with the new agent.

If still can not resolve the issue, just share the build logs here for further troubleshoot.

Upvotes: 3

Related Questions