<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>TFS API on blog.ehn.nu</title><link>https://blog.ehn.nu/categories/tfs-api/</link><description>Recent content in TFS API on blog.ehn.nu</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 09 Mar 2016 20:54:08 +0000</lastBuildDate><atom:link href="https://blog.ehn.nu/categories/tfs-api/index.xml" rel="self" type="application/rss+xml"/><item><title>Talking Visual Studio ALM Extensibility at DevSum16</title><link>https://blog.ehn.nu/2016/03/talking-visual-studio-alm-extensibility-at-devsum16/</link><pubDate>Wed, 09 Mar 2016 20:54:08 +0000</pubDate><guid>https://blog.ehn.nu/2016/03/talking-visual-studio-alm-extensibility-at-devsum16/</guid><description>&lt;p&gt;Last year I had a great time speaking at the DevSum conference, the biggest .NET developer conference in Sweden. Back then, I talked about moving your development to the cloud using Visual Studio Team Services. &lt;a href="http://www.activesolution.se"&gt;Active Solution&lt;/a&gt;, where I work, was a gold partner for this event and in addition to me my colleagues &lt;a href="http://geekswithblogs.net/asmith/Default.aspx"&gt;Alan Smith&lt;/a&gt; and &lt;a href="http://peter.orneholm.com/"&gt;Peter Örneholm&lt;/a&gt; also spoke at the conference. We had a lot of fun in our booth showing the Lego robots running on Raspberry PIs, connected to Azure for movement control and result collection.&lt;/p&gt;</description></item><item><title>Publish a GitHub Release from Visual Studio Team Services</title><link>https://blog.ehn.nu/2016/03/publish-a-github-release-from-visual-studio-team-services/</link><pubDate>Tue, 08 Mar 2016 22:13:43 +0000</pubDate><guid>https://blog.ehn.nu/2016/03/publish-a-github-release-from-visual-studio-team-services/</guid><description>&lt;p&gt;The new build system in Team Foundation Server 2015 and Visual Studio Team Services has from the start made it very easy to integrate with GitHub. This integration allows you to create a build in TFS/VSTS that fetches the source code from a GitHub repository. I have blogged about this integration before, at &lt;a href="https://blog.ehn.nu/2015/06/building-github-repositories-in-tfs-build-vnext/" title="http://blog.ehn.nu/2015/06/building-github-repositories-in-tfs-build-vnext/"&gt;http://blog.ehn.nu/2015/06/building-github-repositories-in-tfs-build-vnext/&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="publisinh-a-githubrelease-from-vsts"&gt;Publisinh a GitHubRelease from VSTS&lt;/h4&gt;
&lt;p&gt;This integration allows you to use GitHub for source code, but use the powerful build system in TFS/VSTS to run your automated builds. But, when maintaining the project at GitHub you often want to publish your releases there as well, with the output from your build.&lt;/p&gt;</description></item><item><title>Introducing GitFlow for Visual Studio</title><link>https://blog.ehn.nu/2015/02/introducing-gitflow-for-visual-studio/</link><pubDate>Thu, 12 Feb 2015 18:12:08 +0000</pubDate><guid>https://blog.ehn.nu/2015/02/introducing-gitflow-for-visual-studio/</guid><description>&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: The exension is now also available for Visual Studio 2015 Preview: &lt;a href="https://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a" title="https://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a"&gt;https://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;GitFlow is a popular workflow that provides a consistent naming convention to your branches as well as clear guidance on how your code should flow through these branches. &lt;br&gt;
GitFlow was introduced by &lt;a href="http://nvie.com/about/"&gt;Vincent Driessen&lt;/a&gt; in &lt;a href="http://nvie.com/posts/a-successful-git-branching-model/"&gt;this post&lt;/a&gt; back in 2010, and quickly caught a lot of attention in the community. Since GitFlow by nature is very prescriptive it made a lot of &lt;br&gt;
sense to implement tooling support for the workflow, which Vincent added shortly after. His repo is available at &lt;a href="https://github.com/nvie/gitflow" title="https://github.com/nvie/gitflow"&gt;https://github.com/nvie/gitflow&lt;/a&gt;, although it hasn’t been updated since 2012. &lt;br&gt;
However, several forks has been made, one of the most active is being developed by Peter van der Does at &lt;a href="https://github.com/petervanderdoes/gitflow" title="https://github.com/petervanderdoes/gitflow"&gt;https://github.com/petervanderdoes/gitflow&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Trigger Visual Studio Release Management vNext from TeamCity</title><link>https://blog.ehn.nu/2015/01/trigger-visual-studio-release-management-vnext-from-teamcity/</link><pubDate>Wed, 14 Jan 2015 22:56:58 +0000</pubDate><guid>https://blog.ehn.nu/2015/01/trigger-visual-studio-release-management-vnext-from-teamcity/</guid><description>&lt;p&gt;The last couple of updates to Visual Studio has included a lot of new functionality for Visual Studio Release Management. The biggest one is the introduction of so called vNext releases, that leverages Powershell DSC for carrying out the provisioning and deployments of environments and applications.&lt;/p&gt;
&lt;p&gt;Also included in Visual Studio 2013 Update 3 was the introduction of a REST API that allows us to both trigger new releases and read back information about them. This API is only available for vNext release templates, and will probably not be implemented for the “old” agentbased deployments.&lt;/p&gt;</description></item><item><title>Copy TFS Build Definitions between Projects and Collections</title><link>https://blog.ehn.nu/2014/06/copy-tfs-build-definitions-between-projects-and-collections/</link><pubDate>Thu, 05 Jun 2014 14:50:54 +0000</pubDate><guid>https://blog.ehn.nu/2014/06/copy-tfs-build-definitions-between-projects-and-collections/</guid><description>&lt;p&gt;The last couple of years it has become apparent that using multiple team projects in TFS is generally a bad idea. There are of course exceptions to this, but there are a lot ot things that becomes much easier to do when you put all of your projects and team in the same team project.&lt;/p&gt;
&lt;p&gt;Fellow ALM MVP Martin Hinshelwood has blogged about &lt;a href="http://nakedalm.com/one-team-project/"&gt;this several times&lt;/a&gt;, as well as other &lt;a href="http://geekswithblogs.net/Optikal/archive/2013/09/05/153944.aspx"&gt;people&lt;/a&gt; in the community. In particular, using the backlog and portfolio management tools makes much more sense when everything is located in the same team project.&lt;/p&gt;</description></item><item><title>Creating a Build Definition using the TFS 2013 API</title><link>https://blog.ehn.nu/2014/01/creating-a-build-definition-using-the-tfs-2013-api/</link><pubDate>Wed, 15 Jan 2014 21:55:13 +0000</pubDate><guid>https://blog.ehn.nu/2014/01/creating-a-build-definition-using-the-tfs-2013-api/</guid><description>&lt;p&gt;Almost four years ago I &lt;a href="http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx"&gt;wrote a post&lt;/a&gt; on how to create a build definition programmatically using the TFS 2010 API. The code is partyl still valid, but since a lot of the information in a build definition is dependent on the build process template, the code in the blog &lt;br&gt;
does not work properly for the TFS 2013 default build templates. In addition, since the introduction of Git in TFS 2013, there are some other differences in how you create a build definition for a Git team project compared to a TFVC team project.&lt;/p&gt;</description></item><item><title>Adding Fake Build Information in TFS 2010</title><link>https://blog.ehn.nu/2012/03/adding-fake-build-information-in-tfs-2010/</link><pubDate>Fri, 30 Mar 2012 21:41:48 +0000</pubDate><guid>https://blog.ehn.nu/2012/03/adding-fake-build-information-in-tfs-2010/</guid><description>&lt;p&gt;We have been using TFS 2010 build for distributing a build in parallel on several agents, but where the actual compilation is done by a bunch of external tools and compilers, e.g. no MSBuild involved. We are using the &lt;a href="http://blogs.msdn.com/b/jimlamb/archive/2010/09/14/parallelized-builds-with-tfs2010.aspx"&gt;ParallelTemplate.xaml template&lt;/a&gt; that Jim Lamb blogged about previously, which distributes each configuration to a different agent. We developed custom activities for running these external compilers and collecting the information and errors by reading standard out/error and pushing it back to the build log.&lt;/p&gt;</description></item><item><title>Managing Build Templates with Community TFS Build Manager</title><link>https://blog.ehn.nu/2012/02/managing-build-templates-with-community-tfs-build-manager/</link><pubDate>Tue, 21 Feb 2012 14:02:04 +0000</pubDate><guid>https://blog.ehn.nu/2012/02/managing-build-templates-with-community-tfs-build-manager/</guid><description>&lt;p&gt;A year ago I blogged about how to &lt;a href="http://geekswithblogs.net/jakob/archive/2010/11/03/managing-build-process-templates-in-tfs-2010-build.aspx"&gt;manage your build process templates using the TFS API&lt;/a&gt;. The main reason for doing this is that you can (and should!) store your “golden” build process templates in a common location in your TFS project collection, and then add them to each team project that requires those templates. This way, you can fix a bug or add a new feature in one place and have the change affect all build definitions.&lt;/p&gt;</description></item><item><title>Avoiding TF237124 when Creating Work Items in New Areas</title><link>https://blog.ehn.nu/2012/01/avoiding-tf237124-when-creating-work-items-in-new-areas/</link><pubDate>Fri, 20 Jan 2012 09:42:41 +0000</pubDate><guid>https://blog.ehn.nu/2012/01/avoiding-tf237124-when-creating-work-items-in-new-areas/</guid><description>&lt;p&gt;At my &lt;a href="http://www.inmetacrayon.no/English/about_inmeta/Pages/default.aspx"&gt;company&lt;/a&gt; we write a lot of tools and extensions that uses the TFS API to automate various things for us. A very common thing to automate is the creation of work items and the areas and iterations structure.&lt;/p&gt;
&lt;p&gt;Creating a work item using the TFS API is simple, just connect to TFS, get the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.workitemstore(v=vs.100).aspx"&gt;WorkItemStore&lt;/a&gt; service object and create a new work item and set any fields that you want to: &lt;br&gt;
&lt;strong&gt;&lt;br&gt;
Creating a work item&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Introducing: Community TFS Build Manager</title><link>https://blog.ehn.nu/2011/12/introducing-community-tfs-build-manager/</link><pubDate>Fri, 30 Dec 2011 12:36:06 +0000</pubDate><guid>https://blog.ehn.nu/2011/12/introducing-community-tfs-build-manager/</guid><description>&lt;p&gt;The latest release of the &lt;a href="http://tfsbuildextensions.codeplex.com/"&gt;Community TFS Build Extensions&lt;/a&gt; include a brand new tool called &lt;em&gt;Community TFS Build Manager&lt;/em&gt; and has been created for two reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An implementation of the Team Foundation Build API which is referenced by the Rangers Build Customization Guidance V2 (available H1 2012) \&lt;/li&gt;
&lt;li&gt;Provide a solution to a real problem. The Community TFS Build Manager is intended to ease the management of builds in medium to large Team Foundation Server environments, though it does provide a few features which all users may find useful.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first version of the tool has been implemented by myself and &lt;a href="http://www.freetodev.com/"&gt;Mike Fourie&lt;/a&gt;. You can download the extension from the Visual Studio Gallery here: &lt;br&gt;
&lt;a href="http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c" title="http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c"&gt;http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c&lt;/a&gt;&lt;/p&gt;</description></item><item><title>First stable release of the Community TFS 2010 Build Extensions</title><link>https://blog.ehn.nu/2011/07/first-stable-release-of-the-community-tfs-2010-build-extensions/</link><pubDate>Mon, 04 Jul 2011 22:50:15 +0000</pubDate><guid>https://blog.ehn.nu/2011/07/first-stable-release-of-the-community-tfs-2010-build-extensions/</guid><description>&lt;p&gt;Today the first stable release of the &lt;a href="http://tfsbuildextensions.codeplex.com/"&gt;Community TFS 2010 Build Extensions&lt;/a&gt; shipped on the CodePlex site. Visual Studio ALM MVP &lt;a href="http://freetodev.com/"&gt;Mike Fourie&lt;/a&gt; (aka Mr &lt;a href="http://msbuildextensionpack.codeplex.com/"&gt;MSBuild Extension Pack&lt;/a&gt;) has been the leader of this project and has done a tremendous job, both in contributing functionality as well as coordinating the work for the first release. Great work Mike! I (as well as several others) have contributed a small part of the activities, I plan to be working on the upcoming releases as well.&lt;/p&gt;</description></item><item><title>Automatically Merging Work Items in TFS 2013</title><link>https://blog.ehn.nu/2011/05/automatically-merging-work-items-in-tfs-2013/</link><pubDate>Tue, 17 May 2011 20:43:31 +0000</pubDate><guid>https://blog.ehn.nu/2011/05/automatically-merging-work-items-in-tfs-2013/</guid><description>&lt;p&gt;** Source available at &lt;a href="http://mergeworkitems.codeplex.com/" title="http://mergeworkitems.codeplex.com/"&gt;http://mergeworkitems.codeplex.com/&lt;/a&gt; **&lt;/p&gt;
&lt;p&gt;Half a year ago I wrote about about &lt;a href="http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx"&gt;Merging Work Items&lt;/a&gt; with a custom check-in policy. The policy evaluated the pending changes and for all pending merges, it traversed the merge history to find the associated work items and let the user add them to the current changeset.&lt;/p&gt;
&lt;p&gt;I promised to post the source to the check-in policy (and I’ve got a lot of requests for it), but I never did. This was primary for two reasons:&lt;/p&gt;</description></item><item><title>Dependency Replication with TFS 2010 Build</title><link>https://blog.ehn.nu/2010/12/dependency-replication-with-tfs-2010-build/</link><pubDate>Wed, 08 Dec 2010 08:02:09 +0000</pubDate><guid>https://blog.ehn.nu/2010/12/dependency-replication-with-tfs-2010-build/</guid><description>&lt;p&gt;Some time ago, I wrote a &lt;a href="http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx"&gt;post&lt;/a&gt; about how to implement dependency replication using TFS 2008 Build. We use this for &lt;em&gt;Library builds&lt;/em&gt;, where we set up a build definition for a common library, and have the build check the resulting assemblies back into source control. The folder &lt;strong&gt;is&lt;/strong&gt; then branched to the applications that need to reference the common library. See the above post for more details.&lt;/p&gt;
&lt;p&gt;Of course, we have reimplemented this feature in TFS 2010 Build, which results in a much nicer experience for the developer who wants to setup a new library build. Here is how it looks: &lt;br&gt;
There is a separate build process template for library builds registered in all team projects \&lt;/p&gt;</description></item><item><title>Managing Build Process Templates in TFS 2010 Build</title><link>https://blog.ehn.nu/2010/11/managing-build-process-templates-in-tfs-2010-build/</link><pubDate>Wed, 03 Nov 2010 02:23:40 +0000</pubDate><guid>https://blog.ehn.nu/2010/11/managing-build-process-templates-in-tfs-2010-build/</guid><description>&lt;p&gt;One of the great new features in TFS 2010 Build was the ability to define Build Process Templates that can be reused across build definitions. The Build Process Template file itself is a Windows Workflow 4.0 xaml file &lt;br&gt;
and can be stored anywhere in source control. When a developer creates a new build definition in Team Explorer, he can choose from a list of Build Process Templates:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/jakob/Windows-Live-Writer/Managing-Build-Process-Templates-in-TFS-_CF49/image_2.png"&gt;&lt;img alt="image" loading="lazy" src="https://blog.ehn.nu/2010/11/managing-build-process-templates-in-tfs-2010-build/23_image_thumb.png" title="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This list is populated with the following build process templates:&lt;/p&gt;</description></item><item><title>Developing and debugging Server Side Event Handlers in TFS 2010</title><link>https://blog.ehn.nu/2010/10/developing-and-debugging-server-side-event-handlers-in-tfs-2010/</link><pubDate>Wed, 27 Oct 2010 22:48:11 +0000</pubDate><guid>https://blog.ehn.nu/2010/10/developing-and-debugging-server-side-event-handlers-in-tfs-2010/</guid><description>&lt;p&gt;&lt;br&gt;
&lt;strong&gt;Update 2012-01-23: Added note about .NET framework&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/hinshelm/Default.aspx"&gt;Martin Hinshelwood&lt;/a&gt; wrote an excellent post recently  &lt;a href="http://nakedalm.com/team-foundation-server-2010-event-handling-with-subscribers/"&gt;http://nakedalm.com/team-foundation-server-2010-event-handling-with-subscribers/&lt;/a&gt; ) about a new type of integration &lt;br&gt;
available in TFS 2010, namely server side event handlers, that is executed within the TFS context. I wasn’t aware of this new feature and as Martin notes, there doesn’t seem to be any material/documentation of it at all. &lt;br&gt;
Previously, when you wanted some custom action to be executed when some event occurs in TFS (check-in, build completed…) you wrote a web/WCF service with a predefined signature and subscribed to the event using bissubscribe.exe. &lt;br&gt;
Usually you want to get more information from TFS than what is available in the event itself so you would have to use the TFS client object model to make new requests back to TFS to get that information. &lt;br&gt;
The deployment of these web services is always a bit of a hassle, especially around security. Also there is no way to affect the event itself, e.g. to stop the event from finishing depending on some condition. This can be done using &lt;br&gt;
server side events.&lt;/p&gt;</description></item><item><title>Creating a Build Definition using the TFS 2010 API</title><link>https://blog.ehn.nu/2010/04/creating-a-build-definition-using-the-tfs-2010-api/</link><pubDate>Mon, 26 Apr 2010 20:09:00 +0000</pubDate><guid>https://blog.ehn.nu/2010/04/creating-a-build-definition-using-the-tfs-2010-api/</guid><description>&lt;p&gt;*** UPDATE 2010-08-17 ** Several people have asked me for a complete sample application, so I have put this together and it is available here: &lt;br&gt;
&lt;a href="http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/CreateTFSBuildDefinition.zip" title="http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/CreateTFSBuildDefinition.zip"&gt;http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/CreateTFSBuildDefinition.zip&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;In this post I will show how to create a new build definition in TFS 2010 using the TFS API. When creating a build definition manually, using Team Explorer, the necessary steps are lined &lt;br&gt;
out in the New Build Definition Wizard:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/jakob/WindowsLiveWriter/CreatingaBuildDefinitionusingtheTFS2010A_12F55/image_4.png"&gt;&lt;img alt="image" loading="lazy" src="https://blog.ehn.nu/2010/04/creating-a-build-definition-using-the-tfs-2010-api/28_image_thumb_1.png" title="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, lets see how the code looks like, using the same order. To start off, we need to connect to TFS and get a reference to the IBuildServer object:&lt;/p&gt;</description></item><item><title>Implementing Release Notes in TFS Team Build 2010</title><link>https://blog.ehn.nu/2010/04/implementing-release-notes-in-tfs-team-build-2010/</link><pubDate>Thu, 15 Apr 2010 23:50:49 +0000</pubDate><guid>https://blog.ehn.nu/2010/04/implementing-release-notes-in-tfs-team-build-2010/</guid><description>&lt;p&gt;In TFS Team Build (all versions), each build is associated with changesets and work items. To determine which changesets that should be associated with the current build, Team Build finds the label of the “Last Good Build” an then aggregates all changesets up unitl the label for the current build. Basically this means that if your build is failing, every changeset that is checked in will be accumulated in this list until the build is successful.&lt;/p&gt;</description></item><item><title>TFS 2010 – Managing Build Agents using the API</title><link>https://blog.ehn.nu/2009/12/tfs-2010-managing-build-agents-using-the-api/</link><pubDate>Tue, 08 Dec 2009 20:47:52 +0000</pubDate><guid>https://blog.ehn.nu/2009/12/tfs-2010-managing-build-agents-using-the-api/</guid><description>&lt;p&gt;In previous versions of TFS, you installed TFS Team Build on the build server and you got one build service agent. It was/is possible to start several build agents on the same server, but it is a bit of a mess. &lt;br&gt;
In addition, for each team project TFS 2008 build service can only execute one at a time (Note that builds from different team project can execute in parallell, a lot of people still don’t know this)&lt;/p&gt;</description></item></channel></rss>