Build Customization using Visual Studio 2010
Posted by: Gouri Sohoni ,
on 4/13/2010,
in
Category Visual Studio
Abstract: Visual Studio 2010 RTM released yesterday and we are all excited about the new features it brings with it. In this article, we will explore the new features and functionality in Visual Studio 2010 for Build Management and Customization.
Build Customization using Visual Studio 2010
Visual Studio 2010 RTM released yesterday (April 12th) and we are excited about the new features it brings with it. In this article, we will explore the new features and functionality in Visual Studio 2010 for Build Management and Customization.
Microsoft has provided lot of new features and functionality with Visual Studio 2010 for Build Management and Customization. Let me list some of those new features first.
1. The process uses workflow foundation based workflow as an engine to execute build. It has xaml based process templates. There is a graphical interface provided with which we can customize the existing process. There are 3 templates provided in the box, namely DefaultTemplate.xaml (normal process template), UpgradeTemplate.xaml (if you already have build definition created with Visual Studio 2005 or 2008) and LabDefaultTemplate.xaml (to be used for builds with lab management).
2. Using these templates, there can be multiple definitions created for builds. Each will defer upon various parameters like what is trigger for build, where to drop the build executables and log files, what items to build, which controller is responsible for build etc.
3. A trigger named ‘Gated Check-in’ is provided so as to avoid build failure because of a problem in code. In Gated Check-in, the pre-defined build gets executed at the time of every check-in and the check-in is successful only if that build is successful. This trigger can be normally incorporated as a part of agile methodology. In this methodology, an application feature is completed first and only then the check-in is done. So we can provide build for each check-in (continuous integration) and check whether the build is a failure or not.
4. As a part of the build report, we can get a list of impacted tests (the tests which need to be run again because of some change in code). This can avoid regression.
5. We can see all the results of code coverage with the summary provided with build.
The default workflow for build definition is as follows :
Build Process Customization:
If we want to add some more activities as a part of the existing process template, there are various ways with which the customizations can be specified.
1. By dragging and dropping existing (predefined) activities from the toolbox and configuring them as required.
2. By creating your own activity by using “Activity Library” with the help of xaml only.
3. By creating your own activity by using “Activity Library” but writing code in it.
We will discuss in detail how to customize the template in this article.If we require certain functionality which is not available directly with the default template we can customize the process. In this article we are going to create a backup folder for build drops for usage as latest builds.
1. When we want to change the existing workflow for the template it is recommended that we create a copy of the existing xaml and work with it rather than changing in the default itself.
2. The copy of existing xaml can be created at the time of creation of a new build definition as shown below:
With the process tab selected, click on ‘show details’ and select New button (the image shows ‘Hide Details’ as it is a toggle control)
Provide the name for the custom template in the area for ‘New File name’
3. Once a copy is created, check-out the copy for edit and ‘Get Latest’. Provide a name of the local folder to map.
4. Select the activity from the toolbox and drop it at the required location in the workflow. In this case, we are creating a backup copy of the build drop. In order to do so, we need to provide the location for “Copy directory” at the place where the drop location is created and the required executables and log files are ready so as to use the same to drop in another location. It is shown with the highlighter in the following diagram
We can also see that the “Copy Files to Drop Location” activity is over at this stage.
Now we need to provide the source and destination for the activity “Copy Directory”. We have given the source as “BuildDetail.DropLocation” and a folder name for destination.
5. Finally we can queue the build definition which is based on the custom xaml we created to see that the build drops copy of the executables and log files at the specified location. Nice!
In the upcoming articles, we will discuss two more ways of customizing build definition template in Visual Studio 2010.
Gouri has an experience of over two decades in training and consulting. She is a Microsoft Certified Trainer (MCT) and conducts training and consulting on Microsoft technologies like Visual Studio 2010 (ALM), SQL Server 2005/2008 BI and SQL Server 2005/2008 developer track.
This article has been editorially reviewed by Suprotim Agarwal.
C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.
We at DotNetCurry are very excited to announce The Absolutely Awesome Book on C# and .NET. This is a 500 pages concise technical eBook available in PDF, ePub (iPad), and Mobi (Kindle).
Organized around concepts, this Book aims to provide a concise, yet solid foundation in C# and .NET, covering C# 6.0, C# 7.0 and .NET Core, with chapters on the latest .NET Core 3.0, .NET Standard and C# 8.0 (final release) too. Use these concepts to deepen your existing knowledge of C# and .NET, to have a solid grasp of the latest in C# and .NET OR to crack your next .NET Interview.
Click here to Explore the Table of Contents or Download Sample Chapters!
Was this article worth reading? Share it with fellow developers too. Thanks!
Gouri is a Trainer and Consultant on Azure DevOps and Azure Development. She has an experience of three decades in software training and consulting. She is a graduate from Pune University and PGDCA from Pune University. Gouri is a Microsoft Most Valuable Professional (MVP) - Developer Technologies (Azure DevOps), Microsoft Certified Trainer (MCT) and a Microsoft Certified Azure DevOps Engineer Expert. She has conducted over 150 corporate trainings on various Microsoft technologies. She is a speaker with Pune User Group and has conducted sessions on Azure DevOps, SQL Server Business Intelligence and Mobile Application Development. Gouri has written more than 75 articles on Azure DevOps, TFS, SQL Server Business Intelligence and SQL Azure which are published on
www.sqlservercurry.com and
www.dotnetcurry.com. You can connect with her on
LinkedIn.