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

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.)"
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!

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.

Related

Invalid path on nuget restore step

I have TFS service on premise. I am trying to setup build and stuck on nuget restore step.
I have pass target solution to settings:
Path to solution or packages.config: $/MyProject/MySolution.sln
On log, nuget fails due to invalid directory
NuGet.exe restore -NonInteractive D:\TFS\agent01\_work\63\s -ConfigFile \\SomePath\Nuget.config -NoCache -Verbosity Detailed
As you can see, invalid target is passed to nuget.
It should be
D:\TFS\agent01\_work\63\s\$\MyProject\MySolution.sln
But is
D:\TFS\agent01\_work\63\s
In other projects works as expected. What could be wrong?
Do you have it declared as a build step? It looks like you somewhere put a remote path where it can't be resolved on the agent. I have a very similar setup running and it works with the NuGet-Installer build step:
It turned out that, the problem was Get Source step.
In Server path variable I had path to solution itself instead of( sln file) of folder to solution.

What do I use for summary file when publishing code coverage results in TFS 2015?

Unfortunately imgur is blocked here at my workplace, so instead of screenshots of my build definition I will have to explain my build definition settings to the best of my ability.
I have two build steps, the first is a maven build step that runs the "package" goal. Under the code coverage section of the maven settings I have the CodeCoverage Tool set as "Cobertura", which is what we use on our local boxes when maven building.
My second build step is "Publish Code Coverage Results". I am not sure exactly what to put for my summary file in the settings of this build step. I think that the problem is that the build agent takes the cobertura folder off of the build machine and puts it somewhere else not on the build machine. This is the log entry for what it is doing:
Uploaded artifact 'C:\TFS_BUILD_AGENTS\agent-1\_work\3\s\target\site\cobertura' to container folder 'Code Coverage Report_35241' of build 35241.
So I either need the Summary File location for wherever it is uploading to, or I need to have it not upload the folder like it is currently doing.
This is what I have as the summary file right now, which does not work:
Code Coverage Report_$(Build.BuildId)\coverage.xml
You could check in this file to TFS and map it down to the build agent server. Then you could some build variables(like $(Build.SourcesDirectory) which represents 'C:\TFS_BUILD_AGENTS\agent-1_work\3\s') to get the file.
So you need to put C:\TFS_BUILD_AGENTS\agent-1\_work\3\...\***.xml. Make sure the file is located at the path your specified.
If the file you want to upload is generated after the step1, please check which path is locates and point it in the Summary file blanket.

Bamboo will not create .IPA files using either xbuild or mdtool

I am trying to create an IPA file from Bamboo by doing this: Firstly I will checkout the default repository, then clone a devops repository, then have a nuget restore task. All of these tasks work perfectly fine but it is the Build for iOS task which is where I create my .IPA file is were I am having the problems. Firstly I am using a command task and the files are being build on a mac-agent(needed to create the .IPA file).
I have tried this two different ways, both ways have different outcomes but basically it is not what I expect to happen. The first way I tried was to use mdtool as the executable which worked like this:
-v build -t:build -p:CustomerApp.iOS *-c:Release|iPhone* CustomerApp.sln
This task will build but the .IPA file will not be created and the log file just says Build for iOS succeeded so I do not know what the problem is for that. The second way that I tried was to use xbuild as the executable which I did it like this:
xbuild /p:Configuration=AppStore /p:Platform=iPhone /p:BuildIpa=true /target:Build CustomerApp.sln
And also tried changing the /p:Configuration=AppStore to /p:Configuration=Release
But both of these responses will return the error
MSBUILD: error MSBUILD0004: Too many project files specified
Note that I know it says error MSBUILD0004 but I am not calling the error the xbuild executable is called with the path: /usr/local/bin/xbuild likewise the mdtool is being called successfully through the path: /Applications/Xamarin Studio.app/Conents/MacOS/mdtool and I have checked that the files exist through the terminal.
What is the reason that the mdtool and xbuild will not create the .IPA file? From what I have seen online it was mainly to do with applications that were not up to date but mine are as shown by the log here:
Already up-to-date.
MSBuild auto-detection: using msbuild version '4.0' from '/usr/local/Cellar/mono/4.6.2.7/lib/mono/4.5'.
All packages listed in packages.config are already installed.
Bamboo is creating a folder which is called MOB-CUSAPP9-JOB1. This is where I want to generate the IPA file from but using that still gives me the error above when using the xbuild way, inside the folder when it is generated it has a file called the CustomerApp.sln which I also tried but got the error as well. Inside the MOB-CUSAPP9-JOB1 files that get created are Mobile.Core.iOS and CustomerApp.iOS I have tried to use all of these and get the same error, I have even tried the whole directory to this but /users/dev/bamboo/etc/MOB-CUSAPP9-JOB1 but got the same result.
Here is an image of the folder that bamboo builds:

Can I Override WebDeploy archive paths through TFS Build?

My team is starting to take on the challenge of automating our Build-Deploy-Test process, beginning with the build.
Right now we have Build Definitions configured in TFS that will publish our site to our servers using Web Deploy, and this is working; however, we aren't able to keep an archive of the packages that would be created with each build because when we turn on package creation with the MSBuild parameter /p:CreatePackageOnPublish=true, the build fails on silly NTFS file length constraints.
Exception Message: TF400889: The following path contains more than the allowed 259 characters: \\builds.tfs.company.com\builds\Project.Dev.Nightly\Project.Dev.Nightly_20130630.6\Debug\_PublishedWebsites\Project.Middleware.Service_Package\Archive\Content\C_C\Builds\1005\Project\Project.Dev.Nightly\Sources\Source\Multi\Middleware\Project.Middleware.Service.
Is there a way that we can break the Archive folder out somewhere else?
You can edit the path by using the _PackageTempDir argument for MSBuild.
Just add _PackageTempDir=D:\{desired dir structure} when you're passing in MSBuild arguments.
More full explanation of this property can be found here -
VS2010 Web Deploy: how to remove absolute paths and automate setAcl?

tf.exe Unable to detrmine the workspace

I am trying to call TF get command via Team Build script. I am getting the following error
Unable to determine the workspace.
Folks over the internet tell that this error is because Team Build cannot find the workspace because it is being called from a directory which is not part of the workspace.
The solution presented is to specify the working directory. I do so. The mappings are ok in Build Definition path as well as in the workspace. But now i get the following error:
Could not find cmd.exe in the current
directory . The directory name is
invalid.
Kindly help.
Thanks
Solved the problem. I added one more binding in my build Definition Workspace Section and referenced files to get/checkin/checkout with the help of variable $(MSBuildSourceDirectory). Meanwhile I ensured that $(SourceDir) is used to specify mapping in the workspace section of my Build Definiton dialog.
(source: geekswithblogs.net)
At the same time i encountered 260-character path limit, so i modified the output directory in build path as described here
(source: geekswithblogs.net)

Resources