Hi I am using TFS 2013 and writing the XAML workflow for the TFS build to run. But in my workflow i have a CreateLabel task and sometimes due to some network issue it is getting timeout and making the TFS build to fail. I want to retry the CreateLabel process two more times and any of it get sucess i want to make the build sucesss.
Unfortunately, TFS does not provide any option to rerun the failed Build activities in Build Process. You may have to rerun the entire build.
Update
As another workaround, you could try to change the build timeout on TFS XAML build agent. Details please follow How to change the build timeout on TFS 2015 XAML build agent
Related
Some original info was changed to make the post more focused on the real issue after it was found.
These are some of the details of the current environment. I listed these only because questions were raised in other posts to determine what was and was not working in the current environment:
Upon check-in TFS 2017 successfully builds a web project on the build agent.
A VS 2017 publish profile can manually transform the project properly
The build machine artifact location includes both the transform and profile files
The artifact location is shown below:
I have researched this in depth on Microsoft's VS site, SO and other forums, but there are so many different answers, many of them for older versions, I have been unable to piece this together. As a result I have several sub-questions.
1) Can transforms be engaged in both Builds and Releases?. I read that transforms are applied during the publish process, not the build process, and that made me wonder if it is even possible to do this during a Build. But then when I was exploring releases, I saw all the same tasks usable in a Build, which suggests I can publish with a transform in either Build or Release. Is that correct?
2) Does TFS 2017 require a lot of special handling to engage a transform file? Some of the posts instructed the editing of the .proj file. I wanted to get a confirmation before doing that kind of detailed manipulation, especially given the improvements in TFS 2017.
The following information is the state of the current build definition named "confPanner-CI". The shaded PS script was successfully used to upload to the hosting location to test the whole process, but that is not adequate for the task at hand which requires transforms to be applied:
The full MSBuild Arguments which also created a temp location for the powershell script are:
/p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=c:\ConfPlnrWeb
If I were to add a task for publishing I saw the Publish Build Artifacts task:
But none of the settings as shown below seem to relate to transforms:
The bottom line question is: How do I configure the build so the web project upload has the proper web transform applied?
Update: The following added after the answer below led to at least one place where VS transforms can be applied during a build, and presumably also a release.
Inside the MSBuild Build solution task set the Configuration as shown below:
Publish Build Artifacts task is used to publish the related artifacts ( The “a” working directory contains the artifacts (also known as the “drop”) that are uploaded at the end of the build) to Visual Studio Team Services/TFS or a file share.
Usually it should be a package and be used in a deploy task such as Deploy: WinRM - IIS Web App Deployment or Azure App Service Deployment to achieved the deployment.
1) Can transforms be engaged in both Builds and Releases?
Yes, you could also do this in a build pipeline with the useage of build deploy task. You need to add the task after the publish build artifacts task.
2) Does TFS 2017 require a lot of special handling to engage a transform file?
update
The BuildConfiguration variable is different in TFS 2017, it's inside
the MSBuild task! Transforms are now applied according
to the MSBuild task Configuration setting.
Edit the .proj file is a method to do the transform. If you don't need to change the transform, it will auto do it during the build.You could also use some 3-rd party task/extension for extra transform such as: XDT Transform
Usually we separate the build and release for the deployment, cause it's easy to configure multiple environments and easy to debug issue. You definitely could do this only in build but with a bloated process. You could refer this tutorial: Build and Deploy Azure Web Apps using Team Foundation Server/Services vNext Builds.
For a separate build and release solution, you could take a look at this blog: Using web.config transforms and Release Manager – TFS 2017/Team Services edition
I get this error in the TFS logs when I try to upload a task in the new TFS build system using the tfx-cli tool:
Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentVersionMismatchException:
The task definition being uploaded requires a minimum agent version of 1.88.0.
The server's agent version is 1.83.2.
Unfortunately that is the agent that TFS provides for download.
It is an On Premise TFS server.
Does anyone know how to get the 1.88 version of the agent?
I did modified the task json file and I was able to upload it however it did not show up in the TFS UI.
And the reason is here:
https://github.com/Microsoft/tfs-cli/issues/30
In summary I was trying to use IISWebAppDeploy task which from the official git repository but that task is still in development and it will not show up in TFS until marked for release.
I suppose 1.88 is the current version of the VSO build agents. At least if I login to my VSO project and switch to the Hosted pool, the hosted agent is of version 1.88. I suspect it is being upgraded by the VSO silently. Thus, if you download an agent from VSO one of these days, it will most likely have version 1.88.
However, I'm not sure it is a good idea. First verify whether you really need a more recent version. The minimalAgentVersion is defined in the custom task definition, the JSON file. Try changing it down to your agent version, 1.83.2. Most likely, you should not require a higher version of the agent in your custom task until you upgrade your TFS instance.
I'm trying to get a project to work with a continuous integration build. Currently, it consists of a library dll, .net 4.5 app, and WP8 app. I use team foundation service with GIT as my source control.
I was able to set up a build configuration but it fails with the following message:
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
This is the ONLY exception in the entire solution, although there are 10 warnings. Additionally, I've run the build with the verbosity to diagnostic and here is the output of that.
Again I don't see any issues with that build, just the cryptic "Done building project.... --FAILED" message. Locally, the project can be built and rebuilt without any issues. Anyone have any idea what might be causing this issue?
Edit:
Through trial and error I've narrowed the issue down to having a windows phone 8 application in my solution. If I exclude that project, the solution builds fine. If it's included, I get the problem. Should I perhaps be using a separate build definition for each project and not for the solution itself? Windows phone 8 projects by themselves build fine...
The error you're getting is occurring within the build template that your build definition is using. Build templates are Windows Workflow files that guide TFS Build through the process of executing a given build. The reason why your project is building locally is that Visual Studio isn't using this build template, as build templates only run on the server under TFS Build.
I dare say someone has customised the build template that your build is using, and that customisation is failing. Based on the error, it seems to be happening during the execution of a CodeActivity, which is now obsolete (though being obsolete isn't actually the issue). The custom code in that CodeActivity is probably failing though.
Assuming your build process doesn't need any specific customisations provided by the failing build template, I'd just select a different one or create a new one. You can do this from the Process tab when editing the build definition.
Hope this helps!
I am responsible over managing our automated builds and recently we have moved two silverlight based web applications into the same solution. Now about half the time when we build through the build server the build fails randomly with one of the two xap files with the following error message.
Xap packaging failed. The process cannot access the file
'G:\Builds\2\Application Suite\Main\Binaries\silverlight app1.xap'
because it is being used by another process.
The structure is as follows:
web app1 BUILDS silverlight app1
web app2 BUILDS silverlight app2
Can some one help me solve this issue it is causing me quite a headache?
For TFS 2013, where MSBuild Multi-Proc parameter is no longer present, try to set MSBuild Arguments to /m:1
See:
http://msdn.microsoft.com/en-us/library/bb651793.aspx
http://social.msdn.microsoft.com/Forums/vstudio/en-US/0b856b65-37de-4256-8a09-e233911985f1/tfs2013-msbuild-problems-with-parallel-build?forum=tfsbuild
It turns out that I had to change the tfs build settings for msbuild to build each of the projects one at a time.
Here are the steps to take:
Goto builds -> Edit Build Definition -> Process Tab -> Edit "MSBuild Multi-Proc" to False
Not the best solution as it slows the total build process down because the projects cannot build in parallel but it worked
I am trying to convert a build system setup with TeamCity and Nant scripts to use TFS2010 (We bought the license and might just as well make use of it) After some work I get the web project to build and deploy to the web-server. We have a domain, API, test and web project in our solution.
How do I configure TFS to run the unit tests that we have written so far? I did configure the build to look for ***.UnitTest.dll in(VS2010) Edit build definition>Process>Automated Tests
Now the build fails with a message that says:"Could not load file or assembly 'nunit.framework, Version=2.5.3.9345" Am I correct when I say that TFS is trying to run NUnit on the build server? I did install NUnit-2.5.3.9345 on that TFS2010 build server and still nothing?
Thank you
Jack
The build facility in TFS uses MSTest as test runner, with which it's tightly integrated.
If you want to run your unit tests with NUnit as part of your build, take a look at the NUnit for Team Build project on CodePlex.
The project started out for TFS 2008, however support for TFS 2010 has been added in version 2.0. Note that this feature is still in early stages of development, so your mileage may vary.
I'm late to the game, because I've had to deal with this issue recently. I found this article helpful for me in this. It didn't work right off the bat, but I found if I added it into my buildscript via the controls in a similar manner/pattern, it would work.
My only problem now has been getting it to actually error (right now it warns) even when flagging them to cause the build to error
Link: http://blog.gfader.com/2011/06/running-nunit-tests-in-tfs-2010.html