[{"content":"If you are doing any work related to containers and Azure, you are most likely using Azure Container Registry for storing images. The amoun of storage available for these images depends on the pricing tier you are using.\nIf you exceed this amount of storage, you will pay an additional fee for every GB of image data that exceeds the limit. See the table below for the current pricing details.\nAzure Container Registry pricing details\n100GB of included storage might sound much, but you will pretty soon find out that your CI pipelines will fill up this space with new image versions being pushed on every commit.\nNow, if you select the Premium tier, there is a retention policy feature available (https://docs.microsoft.com/en-us/azure/container-registry/container-registry-retention-policy), but the Premium tier will cost you three times as much.\nImplementing purging of older images in ACR yourself is easy using the Azure CLI/Powershell, but you need some mechanism of hosting and running these scripts whenever you push a new image to your registry.\nThis is a perfect case for Brigade, it already comes with a Container Registry gateway that will respond to webhooks and translate that into Brigade events, and you can host everything inside your existing Kubernetes cluster.\nSee my introductory post on Brigade here:\nhttps://blog.ehn.nu/2020/01/event-driven-scripting-in-kubernetes-with-brigade/\nThe overall solution will look like this:\nWhenever a new image is pushed the an Azure Container Registry, it will send a request to a Brigade Container Registry gateway running in your Kubernetes cluster of choice. This will in turn kick off a build from a Brigade project, that contains a script that will authenticate back to the registry and purge a selected set of older images.\nThe source code for the Brigade javascript pipeline, including the custom Bash script is available here:\nhttps://github.com/jakobehn/brigade-acr-retention\nLet’s go through the steps needed to get this solution up and running. If you want to, you can use the GitHub repository directly, or you’ll want to store these scripts in your own source control.\nCreate a Service Principal To be able to purge images in Azure Container Registry from a Docker container running in our Brigade pipeline, we will create a service principal. This can be done by running the following command:\naz ad sp create-for-rbac --name ACRRetentionPolicy Changing \u0026#34;ACRRetentionPolicy2\u0026#34; to a valid URI of http://ACRRetentionPolicy, which is the required format used for service principal names { \u0026#34;appId\u0026#34;: \u0026#34;48408316-6d71-4d36-b4ea-37c63e3e063d\u0026#34;, \u0026#34;displayName\u0026#34;: \u0026#34;ACRRetentionPolicy\u0026#34;, \u0026#34;name\u0026#34;: http://ACRRetentionPolicy, \u0026#34;password\u0026#34;: \u0026#34;\u0026lt;\u0026lt;EXTRACTED\u0026gt;\u0026gt;\u0026#34;, \u0026#34;tenant\u0026#34;: \u0026#34;\u0026lt;\u0026lt;EXTRACTED\u0026gt;\u0026gt;\u0026#34; } Make a note of the appId, password and tenantId as you will be using them later on.\nInstall Brigade If you haven’t already, install Brigade in your Kubernetes cluster. Make sure to enable Brigade’s Container Registry gateway by setting the cr.enabled property to true:\nhelm repo add brigade https://brigadecore.github.io/charts helm repo update helm install -n brigade brigade/brigade --set cr.enabled=true,cr.service.type=LoadBalancer Verify that all components of Brigade are running:\nPS C:\\brigade\u0026gt; kubectl get pods NAME READY STATUS RESTARTS AGE\nbrigade-server-brigade-api-58d879df79-dczl6 1/1 Running 0 8d\nbrigade-server-brigade-cr-gw-577f5c787b-kx2m4 1/1 Running 0 8d\nbrigade-server-brigade-ctrl-8658f456c4-pbkx2 1/1 Running 0 8d\nbrigade-server-kashti-7546c5567b-ltxqm 1/1 Running 0 8d\nList the services and make a note of the public IP address of the Container Registry gateway service:\nPS C:\\brigade\u0026gt; kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\nbrigade-server-brigade-api ClusterIP 10.0.188.158 7745/TCP 8d\nbrigade-server-brigade-cr-gw LoadBalancer 10.0.6.148 40.114.186.81 80:31844/TCP 8d\nbrigade-server-kashti ClusterIP 10.0.193.112 80/TCP 8d\nkubernetes ClusterIP 10.0.0.1 443/TCP 13d\nBrigade script Every Brigade pipeline reference a Javascript file that will respond to various events and chain the jobs together using container images. As seen below, the necessary parameters are passed in as environment variables.\nThe values of the variables are fetched from the secrets from the Brigade project that we’ll create in the next step.\nWhen the image_push event is received (from the Brigade Container Registry gateway), the script creates a job, passes in the environment variables and define the tasks to be run inside the container. We are using the mcr.microsoft.com/azure-cli Docker image, which is the official image for using the Azure CLI inside a container. The task runs the purge-images.sh script, which is available in the /src folder. When a Brigade project refers to a Git repository, the source will automatically be cloned into this folder inside the container, using a Git side-car container.\nconst { events, Job} = require(\u0026ldquo;brigadier\u0026rdquo;);\nevents.on(\u0026#34;image_push\u0026#34;, async (e, p) =\u0026gt; { var purgeStep = new Job(\u0026#34;purge\u0026#34;, \u0026#34;mcr.microsoft.com/azure-cli\u0026#34;) purgeStep.env = { subscriptionName: p.secrets.subscriptionName, registryName: p.secrets.registryName, repositoryName: p.secrets.repositoryName, minImagesToKeep: p.secrets.minImagesToKeep, spUserName: p.secrets.spUserName, spPassword: p.secrets.spPassword, spTenantId: p.secrets.spTenantId } purgeStep.tasks = [ \u0026#34;cd src\u0026#34;, \u0026#34;bash purge-images.sh\u0026#34;, ]; purgeStep.run(); });\nScript for purging images from Azure Container Registry The logic of purging older images from the container registry is implemented in a bash script, called purge-images.sh, also located in the GitHub repository. It authenticates using the service principal, and then lists all image tags from the corresponding container registry and deletes all image except the latest X ones (configured through the minImagesToKeep environment variable).\n#Login using supplied SP and select the subscription az login --service-principal --username $spUserName --password $spPassword --tenant $spTenantId az account set --subscription \u0026#34;$subscriptionName\u0026#34; # Get all the tags from the supplied repository TAGS=($(az acr repository show-tags --name $registryName --repository $repositoryName --output tsv --orderby time_desc)) total=${#TAGS[*]} for (( i=$minImagesToKeep; i\u0026lt;=$(( $total -1 )); i++ )) do imageName=\u0026#34;$repositoryName:${TAGS[$i]}\u0026#34; echo \u0026#34;Deleting image: $imageName\u0026#34; az acr repository delete --name $registryName --image $imageName --yes done echo \u0026ldquo;Retention done\u0026rdquo;\nCreating the Brigade project To create a project in Brigade, you need the Brigade CLI. Running brig project create will take you through a wizard where you can fill out the details.\nIn this case, I will point it to the GitHub repository that contains the Brigade.js file and the bash script.\nHere is the output:\nPS C:\\acr-retention-policy\u0026gt; brig project create ? VCS or no-VCS project? VCS\n? Project Name jakobehn/brigade-acr-retention\n? Full repository name github.com/jakobehn/brigade-acr-retention\n? Clone URL (https://github.com/your/repo.git) https://github.com/jakobehn/brigade-acr-retention.git\n? Add secrets? Yes\n? Secret 1 subscriptionName\n? Value Microsoft Azure Sponsorship\n? ===\u0026gt; Add another? Yes\n? Secret 2 registryName\n? Value jakob\n? ===\u0026gt; Add another? Yes\n? Secret 3 repositoryName\n? Value acrdemo\n? ===\u0026gt; Add another? Yes\n? Secret 4 minImagesToKeep\n? Value 5\n? ===\u0026gt; Add another? Yes\n? Secret 5 spUserName\n? Value \u0026laquo;EXTRACTED\u0026raquo;\n? ===\u0026gt; Add another? Yes\n? Secret 6 spPassword\n? Value \u0026laquo;EXTRACTED\u0026raquo;\n? ===\u0026gt; Add another? Yes\n? Secret 7 spTenantId\n? Value \u0026laquo;EXTRACTED\u0026raquo;\n? ===\u0026gt; Add another? No\n? Where should the project\u0026rsquo;s shared secret come from? Specify my own\n? Shared Secret \u0026laquo;EXTRACTED\u0026raquo;\n? Configure GitHub Access? No\n? Configure advanced options No\nProject ID: brigade-c0e1199e88cab3515d05935a50b300214e7001610ae42fae70eb97\nSetup ACR WebHook Now we have everything setup, the only thing that is missing is to make sure that your Brigade project is kicked off every time a new image is pushed to the container registry. To do this, navigate to your Azure Container Registry and select the Webhooks tab. Create a new webhook, and point it to the IP address of your container registry gateway that you noted before.\nNote the format of the URL, read more about the Brigade container registry here: https://docs.brigade.sh/topics/dockerhub/\nCreating an ACR webhook\nTo only receive events from one specific repository, I have specified the Scope property and set it to acrdemo:*, which effectively filters out all other push events.\nTrying it out Let’s see if this works then, shall we? I’m pushing a new version of my demo images (jakob.azurecr.io/acrdemo:1.17) , and then run the Brigade dashboard (brig dashboard).\nI can see that a build has been kicked off for my project, and the result looks like this:\nI can see that I got a image_push event and that the build contained one job called purge (that name was specified in the Javascript pipeline when creating the job). We can drill down into this job and see the output from the script that was executed:\nSince I specfied minImageToKeep to 5, the script now deleted version 1.12 (leaving the 5 latest versions in the repository).\nHope you found this valuable!\n\\\n","permalink":"https://blog.ehn.nu/2020/04/implementing-azure-container-registry-retention-with-brigade/","summary":"\u003cp\u003eIf you are doing any work related to containers and Azure, you are most likely using \u003ca href=\"https://azure.microsoft.com/en-us/services/container-registry/\"\u003eAzure Container Registry\u003c/a\u003e for storing images. The amoun of storage available for these images depends on the pricing tier you are using.\u003cbr\u003e\nIf you exceed this amount of storage, you will pay an additional fee for every GB of image data that exceeds the limit. See the table below for the current pricing details.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAzure Container Registry pricing details\u003c/strong\u003e\u003c/p\u003e","title":"Implementing Azure Container Registry Retention with Brigade"},{"content":"I’ve been playing around with the Dapr project recently, which is an interesting approach to building distributed, “microservices” applications. Tha main idea with Dapr is to make it easier for developers to implement distributed application running either in the cloud or on “the edge” (e.g. anywhere else), by implementing a lot of the cross-cutting concerns that is a part of every distributed app. Dapr consists of a number of building blocks, such as Service Invocation, State Service, Pub/Sub messaging and distributed tracing.\nRead more about the main concepts of Dapr here:\nhttps://github.com/dapr/docs/tree/master/concepts\nThe architecture of Dapr makes local devlopment a bit special. Dapr uses a Sidecar architecture, meaning that the Dapr runtime runs in a separate process (or container if you’re running in Kubernetes), and all interaction beween your application and the Dapr runtime is done using HTTP/gRPC calls to that sidecar process:\nImage from https://github.com/dapr/docs/tree/master/overview\nYou can read more about how to run Dapr locally here, but essentially you’ll use the Dapr CLI to run or debug your application. The Dapr CLI will in turn launch your application and configure the necessary environment variables and sidecar pod injectors etc to make sure that your application can communicate with the Dapr runtime.\nThis can be a bit cumbersome when you want to be able to quickly iterate when working locally, but Visual Studio Code makes this process fairly simple. Let’s walk through how to set this up.\nDebugging an ASP.NET Core Dapr app First of all, if you haven’t installed Dapr, follow the simple instructions here to do so. Use the standalone mode when you get started:\nhttps://github.com/dapr/docs/blob/master/getting-started/environment-setup.md\nNext up, we will be using a Visual Studio Code extension for Dapr that can automate and simplify a lot of tasks when it comes to working with Dapr applications, so go ahead and install this:\nhttps://github.com/microsoft/vscode-dapr\nLet’s create a ASP.NET Core web application and see how we can build, run and debug this application using Visual Studio Code.\nCreate a new folder for your application In the folder, create a new ASP.NET Core web app using the dotnet CLI:dotnet new mvc -n daprweb Open Visual Studio code in the current folder by running:code . To configure how VSCode runs and debug an application you need to add and/or modify the launch.json and tasks.json files that are located in the .vscode folder in the root directory.\nIf you don’t see them you need to restore and build the project at least once in VSCode.After that, hit CTRL + P and then select *Dapr: Scaffold Dapr Tasks\n* ****\\\nFor the configuration, select the .NET Core Launch (web) configuration Give the app a name (daprweb) and select the default port for the app (5000) When done, take a look at the launch.json file. You’ll see that the extension added a new configuration called .NET Core Launch (web) with Dapr. It is very similar to the default .NET Core launch configuration, but is has a special preLaunchTask and a postDebugTask. These tasks have also been added by the extension to the tasks.json file Take a look at Tasks.json to see the new tasks: You can see that the darp-debug task has the type “daprd” which is a reference to the Dapr CLI debugger. The task depends on the build task, which means that it will trigger a build when you launch the configuration. The other task is daprd-down, which is called when you stop a debug session, which enables the extension to finish Daprd correctly.\\\nTo debug the application, simply navigate to the Run tab and select the .NET Core Launch (web) with Dapr configuration in the dropdown bar at the top: If you set a breakpoint in the Home controller, it should be hit immediately when you start debugging the application: Debugging multiple Dapr applications What about running and debugging multiple Dapr applications at the same time? If you for example have a web app that calls an API app, you would most likely want to be able ro run and debug them simultaneously.\nIt works pretty much the same way. Here I have added a ASP.NET Core Web API application, and then added another launch configuration:\nTo be able to build and run both applications at the same time, the best way is to add a solution file with the two projects in it, and then change the Build task to build from the solution folder instead.\nHere I have changed the argument to the build command to point to the workspace folder root:\nNow, to easily start both applications with a single command, you can add a compound launch configuration that will reference the applications that you want to start. Add the following to your launch.json file:\nSelect this configuration when starting a debug session in VSCode, this will start up both applications at the same time.\nI hope this post was helpful, I’ll write more posts about Dapr in the near future so stay tuned\nComments Imported from the original WordPress site. Closed for new replies.\nDaniel Larsen — 29 Dec 2020\nAmazing article! Saved me loads of time. Thank you.\n","permalink":"https://blog.ehn.nu/2020/03/debugging-dapr-applications-with-visual-studio-code/","summary":"\u003cp\u003eI’ve been playing around with the \u003ca href=\"https://dapr.io/\"\u003eDapr\u003c/a\u003e project recently, which is an interesting approach to building distributed, “microservices” applications. Tha main idea with Dapr is to make it easier for developers to implement distributed application running either in the cloud or on “the edge” (e.g. anywhere else), by implementing a lot of the cross-cutting concerns that is a part of every distributed app. Dapr consists of a number of building blocks, such as Service Invocation, State Service, Pub/Sub messaging and distributed tracing.\u003c/p\u003e","title":"Debugging Dapr applications with Visual Studio Code"},{"content":"Visual Studio has for quite some time been adding features to make it easier to create, build, run and debug Dockerized applications. This is great, because Docker can be quite daunting when you intially approach it and anything that makes that journey easier should be encouraged.\nHowever, with this tooling support comes some magic that is performed behind the scene when you hit F5 in Visual Studio. I have on numerous different occasions explained to developers what actually happens when you build and debug a Dockerized application in Visual Studio. With this post, I can send them here instead the next time 🙂\nAdding Docker support Let’s start by taking an existing web project in Visual Studio 2019 and add Docker support to it, and then we’ll examine the details.\nIf you have a .NET or .NET Core application open in Visual Studio, you can right-click the project and select “Add –\u0026gt; Docker support”. You will be prompted if you want to use Linux or Windows containers, if you are doing .NET Core you will most likely want to use Linux containers here, if it is a full .NET Framework apps you have to go with Windows containers here.\nNote: The below walkthrough are for Linux containers. For Windows containers the Docker file will look a lot different, but the overall process is the same\nHere, I have a ASP.NET Core 3.1 web application called MyDockerWebApp:\nThis will generate the following Dockerfile and add it to the project:\nFROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base WORKDIR /app EXPOSE 80 EXPOSE 443 FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build WORKDIR /src COPY [\u0026#34;MyDockerWevApp/MyDockerWevApp.csproj\u0026#34;, \u0026#34;MyDockerWevApp/\u0026#34;] RUN dotnet restore \u0026#34;MyDockerWevApp/MyDockerWevApp.csproj\u0026#34; COPY . . WORKDIR \u0026#34;/src/MyDockerWevApp\u0026#34; RUN dotnet build \u0026#34;MyDockerWevApp.csproj\u0026#34; -c Release -o /app/build FROM build AS publish RUN dotnet publish \u0026#34;MyDockerWevApp.csproj\u0026#34; -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT [\u0026#34;dotnet\u0026#34;, \u0026#34;MyDockerWevApp.dll\u0026#34;] This is a multi-stage Docker file, which means that when Docker builds this file it will go through multiple phases (each starting with a FROM statement) where each statement will produce a temporary image, that can be used in a subsequent step. This makes it possible to generate optimized images in the end suitable for running in production. (Again, for .NET Framework apps and Windows containers, the generated Dockerfile will not be a multi-stage file)\nThe Docker file looks a bit unusual though, the first phase called “base” doesn’t really do anything. What’s the point with that phase? As it turns out, this phase has a special meaning for Visual Studio, we’ll see when we examine how Visual Studio runs and debug Docker projects.\nBuilding and running the containerized application When building the project, you might expect that Visual Studio would build the Dockerfile and produce a Docker image. This is not the case however, at least not when building the Debug configuration. It’s actually when you run the project that Visual Studio will build an image and start a container using that image. Let’s take a look at the output when pressing F5. I’m only showing the relevant parts here, intended for readability:\ndocker build -f \u0026#34;C:\\src\\MyDockerWebApp\\MyDockerWebApp\\Dockerfile\u0026#34; --force-rm -t mydockerwebapp:dev --target base --label \u0026#34;com.microsoft.created-by=visual-studio\u0026#34; --label \u0026#34;com.microsoft.visual-studio.project-name=MyDockerWevApp\u0026#34; \u0026#34;C:\\src\\MyDockerWebApp\u0026#34; Here you can see that Visual Studio runs a Docker build operation with the Dockerfile as input, and naming the generated image :dev. However, there is one important parameter: –target base. This means that Visual Studio will only build the first phase, called base. This will then produce a Docker image that is just the ASP.NET Core 3.0 base image, it won’t contain any application files at all from my project!\nThe reason for this is that Visual Studio tries to be smart and avoid rebuilding the Docker image every time you press F5. That would be a very slow inner loop for developers. This is called “fast” mode, and can be disabled if you always want to build the full image even in Debug mode. If you want to add something more to the image that is used in fast mode, you have to add the Docker instructions it this phase.\nYou can disable fast mode by adding the following to your .csproj file:\n\u0026lt;PropertyGroup\u0026gt; \u0026lt;ContainerDevelopmentMode\u0026gt;Regular\u0026lt;/ContainerDevelopmentMode\u0026gt; \u0026lt;/PropertyGroup\u0026gt; If you switch to the Release configuration and run, Visual Studio will process the whole Dockerfile and generate a full image called :latest. This is what you will do on your CI server\nSo, how does Visual Studio actually run the application then? Let’s look a bit further down in the output log to understand what happens:\\\nC:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File \u0026#34;C:\\Users\\jakobe\\AppData\\Local\\Temp\\GetVsDbg.ps1\u0026#34; -Version vs2017u5 -RuntimeID linux-x64 -InstallPath \u0026#34;C:\\Users\\jakobe\\vsdbg\\vs2017u5\u0026#34; Info: Using vsdbg version \u0026#39;16.3.10904.1\u0026#39; Info: Using Runtime ID \u0026#39;linux-x64\u0026#39; Info: Latest version of VsDbg is present. Skipping downloads C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File \u0026#34;C:\\Users\\jakobe\\AppData\\Local\\Temp\\GetVsDbg.ps1\u0026#34; -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath \u0026#34;C:\\Users\\jakobe\\vsdbg\\vs2017u5\\linux-musl-x64\u0026#34; Info: Using vsdbg version \u0026#39;16.3.10904.1\u0026#39; Info: Using Runtime ID \u0026#39;linux-musl-x64\u0026#39; Info: Latest version of VsDbg is present. Skipping downloads These steps downloads and executes a Powershell scripts that will in turn download and install the Visual Studio remote debugging tools to your local machine. Note that this will only happen the first time, after that it will skip the download and install as you can see from the logs above.\ndocker run -dt -v \u0026#34;C:\\Users\\je\\vsdbg\\vs2017u5:/remote_debugger:rw\u0026#34; -v \u0026#34;C:\\src\\MyDockerWebApp\\MyDockerWebApp:/app\u0026#34; -v \u0026#34;C:\\src\\MyDockerWebApp:/src\u0026#34; -v \u0026#34;C:\\Users\\je\\AppData\\Roaming\\Microsoft\\UserSecrets:/root/.microsoft/usersecrets:ro\u0026#34; -v \u0026#34;C:\\Users\\je\\AppData\\Roaming\\ASP.NET\\Https:/root/.aspnet/https:ro\u0026#34; -v \u0026#34;C:\\Users\\je\\.nuget\\packages\\:/root/.nuget/fallbackpackages2\u0026#34; -v \u0026#34;C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder:/root/.nuget/fallbackpackages\u0026#34; -e \u0026#34;DOTNET_USE_POLLING_FILE_WATCHER=1\u0026#34; -e \u0026#34;ASPNETCORE_ENVIRONMENT=Development\u0026#34; -e \u0026#34;NUGET_PACKAGES=/root/.nuget/fallbackpackages2\u0026#34; -e \u0026#34;NUGET_FALLBACK_PACKAGES=/root/.nuget/fallbackpackages;/root/.nuget/fallbackpackages2\u0026#34; -p 50621:80 -p 44320:443 --entrypoint tail mydockerwebapp:dev -f /dev/null This is where Visual Studio actually starts the container, let’s examine the various (interesting) parameters:\n-v \u0026ldquo;C:\\Users\\je\\vsdbg\\vs2017u5 : /remote_debugger:rw\u0026rdquo;\nThis mounts the path to the Visual Studio remote debugger tooling into the container. By doing this, Visual Studio can attach to the running process inside the container and you can debug the applicatoin just like you would if it was running as a normal process.\n-v \u0026ldquo;C:\\Users\\je\\vsdbg\\vs2017u5 : /remote_debugger:rw\u0026rdquo;\n-v \u0026ldquo;C:\\src\\MyDockerWebApp : /src\u0026rdquo;\nThese two parameters maps the project directory into the /app and /src directory of the container. This means that when the container is running, and the web app starts, it is actually using the files from the host machine, e.g. your development machine. This ameks it possible for you to make changes to the source files and have that change immediately available in the running container\n-v \u0026ldquo;C:\\Users\\je\\AppData\\Roaming\\Microsoft\\UserSecrets : /root/.microsoft/usersecrets:ro\u0026rdquo; Makes the UserSecrets folder from the roaming profile folder available in the container\nC:\\Users\\je\\AppData\\Roaming\\ASP.NET\\Https : /root/.aspnet/https:ro\u0026quot;\nMounts the path where the selfsigned certificates are stored, into the container\n-v \u0026ldquo;C:\\Users\\je.nuget\\packages\\ : /root/.nuget/fallbackpackages2\u0026rdquo; -v \u0026ldquo;C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder : /root/.nuget/fallbackpackages\u0026rdquo;\nMounts the local NuGet package cache folder and the NuGet fallback folder into the container. These files are read by the *.nuget.g.props files that are generated in the obj folder of your project\nSummary The result of this magic is that you can just run your project, make changes to it while running and have the changes immediately be applied, and also add breakpoints and debug your applications just like you are used to, even though the are running inside containers.\nI hope this will shed some light on what’s going on when you are building and running Dockerized projects in Visual Studio.\n","permalink":"https://blog.ehn.nu/2020/02/how-visual-studio-2019-supports-containerized-applications/","summary":"\u003cp\u003eVisual Studio has for quite some time been adding features to make it easier to create, build, run and debug Dockerized applications.  This is great, because Docker can be quite daunting when you intially approach it and anything that makes that journey easier should be encouraged.\u003c/p\u003e\n\u003cp\u003eHowever, with this tooling support comes some magic that is performed behind the scene when you hit F5 in Visual Studio. I have on numerous different occasions explained to developers what actually happens when you build and debug a Dockerized application in Visual Studio. With this post, I can send them here instead the next time 🙂\u003c/p\u003e","title":"How Visual Studio 2019 supports containerized applications"},{"content":"In most projects that I’ve been part of, sooner or later the need for various types of automation jobs arises. For example cleaning up old files, moving database backups, running health checks or system tests and so on.\nHistorically we’ve implemented these tasks using for example the Windows task scheduler, or through some custom Windows Service app. More recently, we’ve been using Azure Automation jobs for this. Sometimes it can also make sense to use CI/CD automation tools like Azure DevOps for these jobs.\nWith the move to containers and Kubernetes, it can make a lot of sense to use that platform not just for the business apps that you are developing, but also for these type of automation workloads. It means that you don’t have to invest and manage another platform, and you can leverage existing and 3rd part container images to build automation workflows.\nBrigade Brigade is a platform that makes it easy to create simple or complex workflows that run on Kubernetes. You use Docker containers as the basis for each step in the workflow, and wire them together using Javascript.\nBrigade is an open-source project, read more about it at:\nhttps://brigade.sh/\nBrigade runs on any vanilla Kubernetes cluster, you don’t need anything extra installed to run brigade pipelines.\nInstalling Brigade is as easy as running the following two commands:\nhelm repo add brigade https://brigadecore.github.io/charts helm install brigade/brigade --name brigade-server The image below shows the main concepts in use by Brigade:\nProject\nFor every automation workflow that you want to implement, you will create a project. Every project has some metadata attached to it, such as id, name and so on. It also either contains or reference the Javascript code that contains the pipeline logic.\nBuild\nA build is created every time a script is triggered, through some external event. The build runs until all jobs are finished, and you can view the output logs from the running build as well as after it finished.\nJob\nEach build will contain one or more jobs. For each job, a container instance is started, and then a series of tasks is executed inside that container. You specify the jobs and the tasks in the Javascript code, and how the jobs should be scheduled.\nGateway\nA gateway transform outside triggers (a Git pull request, a Trello card move etc) into events, that is passed into the pipeline where you will handle them in your code.\nBrigade comes with a Generic gateway that listens and accepts POST JSON messages on any format (it also explicitly supports the CloudEvents format). In addition, there are several custom gateways that makes integration a lot easier with services such as GitHub, Docker Container Registry or Azure Event Grid.\nA basic “hello-world” type of Brigade pipeline can look like this:\nconst { events, Job } = require(\u0026#34;brigadier\u0026#34;); //Handler for exec event events.on(\u0026#34;exec\u0026#34;, () =\u0026gt; { var job = new Job(\u0026#34;say-hello\u0026#34;, \u0026#34;alpine:3.8\u0026#34;); job.tasks = [ \u0026#34;echo Hello\u0026#34;, \u0026#34;echo World\u0026#34; ]; job.run(); }); Here, the pipeline is triggered by the exec event, and inside that event handler it starts a new job called “say-hello” which contains two tasks where each task just prints a message. The job is executed inside a container from the alpine:3.8 image, that will be downloaded from Dockerhub and started automatically for you. Of course you can use any public image, or a private image from your own container registry.\nBrigade has excellent documentation, I encourage you to read up on it more at https://docs.brigade.sh/\nIn this post I will show a slightly more complex example, that is taken from a recent customer project where we developed a microservice application running on Kubernetes, and found the need for some extra automation.\nRemoving Kubernetes environment on PR completion Kubernetes makes it easy to create new isolated environments for your application when you need to. A common desire of many teams is to deploy the application into a fresh environment every time a pull request is created. This lets the team and stakeholders test and verify the feature that is being developed, before it gets merged into the master branch.\nUsing Azure DevOps, it’s quite easy to setup a release pipeline where every PR is deployed into a new namespace in Kubernetes. You can enable stages in a pipeline to be triggered by pull requests, and then use information from that PR to create a new namespace in your Kubernetes cluster and then deploy the app into that namespace.\nThe problem we experienced recently at a customer with this was, how can we make sure this namespace (and everything in it) is removed once the PR is complete and merged? We can’t keep it around since that will consume all the resources eventually in the cluster, and we don’t want to rely on cleaning this up manually.\nThis turned out to be a perfect case for Brigade. We can configure a service hook in Azure DevOps, so that every time a PR is updated we trigger a Brigade pipeline. In the pipeline we check if the PR was completed and if so, extract the relevant information from the PR and then clean up the corresponding namespace. To do this, we used existing container images that let us run helm and kubecl commands.\nThe Brigade script looks like this:\nconst { events, Job } = require(\u0026#34;brigadier\u0026#34;); const util = require(\u0026#39;util\u0026#39;) const HELM_VERSION = \u0026#34;v2.13.0\u0026#34; const HELM_CONTAINER = \u0026#34;lachlanevenson/k8s-helm:\u0026#34; + HELM_VERSION; const KUBECTL_VERSION = \u0026#34;v1.12.8\u0026#34;; const KUBECTL_CONTAINER = \u0026#34;lachlanevenson/k8s-kubectl:\u0026#34; + KUBECTL_VERSION; events.on(\u0026#34;simpleevent\u0026#34;, (event, project) =\u0026gt; { const payload = JSON.parse(event.payload); const prId = payload.resource.pullRequestId; if (!payload.resource.sourceRefName.includes(\u0026#39;/feature/\u0026#39;) \u0026amp;\u0026amp; !payload.resource.sourceRefName.includes(\u0026#39;/bug/\u0026#39;)) { console.log(`The source branch ${payload.resource.sourceRefName} is not a /feature/ or /bug/ and is therefore skipped.`) return; } if (payload.resource.status !== \u0026#34;completed\u0026#34; \u0026amp;\u0026amp; payload.resource.status !== \u0026#34;abandoned\u0026#34;) { console.log(`PullRequest not complete or abandoned (current status: ${payload.resource.status}).`); return; } var helm_job = new Job(\u0026#34;helm-delete-release\u0026#34;, HELM_CONTAINER); helm_job.env = { \u0026#39;HELM_HOST\u0026#39;: \u0026#34;10.0.119.135:44134\u0026#34; }; helm_job.tasks = [\u0026#34;helm init --client-only\u0026#34;, `helm delete --purge samplewebapp-${prId}`]; var kubectl_job = new Job(\u0026#34;kubectl-delete-ns\u0026#34;, KUBECTL_CONTAINER); kubectl_job.tasks = [`kubectl delete namespace samplewebapp-${prId}`]; console.log(\u0026#34;==\u0026gt; Running helm_job Job\u0026#34;) helm_job.run().then(helmResult =\u0026gt; { console.log(helmResult.toString()) kubectl_job.run().then(kubectlResult =\u0026gt; { console.log(kubectlResult.toString()); }); }) }); events.on(\u0026#34;error\u0026#34;, (e) =\u0026gt; { console.log(\u0026#34;Error event \u0026#34; + util.inspect(e, false, null)) console.log(\u0026#34;==\u0026gt; Event \u0026#34; + e.type + \u0026#34; caused by \u0026#34; + e.provider + \u0026#34; cause class\u0026#34; + e.cause + e.cause.reason) }) events.on(\u0026#34;after\u0026#34;, (e) =\u0026gt; { console.log(\u0026#34;After event fired \u0026#34; + util.inspect(e, false, null)) }); This code is triggered when the “simpleevent” event is triggered. This event is handled by the generic gateway in Brigade, and can be used to send any kind of information (as a json document) to your pipeline. To trigger this event, we configure a service hook in Azure DevOps for the Pull Request updated event, and point it to the generic gateway:\nThe full URL looks like this:\nhttps://brigadedemo.ehn.nu/simpleevents/v1/brigade-55cbf57f7aaeb59afa1fe4d33ca6a5a635eefe060b057c423c97a0/somesecret\nThe URL contains the project id and the secret that were specified when creating the project. This is how external requests is authenticated and routed to the correct brigade script.\nInside the event handler we use two different container images, the first one is for running a Helm command to delete the Kubernetes deployment. Since Helm can’t delete the namespace, we need to run a second job inside another container image that contains the Kubectl tool, where we can delete the namespace by running\nkubectl delete namespace samplewebapp-${prId}`\nThe prId variable is parsed from the PullRequest updated event coming from Azure DevOps. We use the id of the pull request to create a unique namespace (in this case pull request with id 99 will be deployed into the samplewebapp-99 namespace).\nNB: You will need to make sure that the service account for brigade have enough permission to delete the namespace. Namespaces are a cluster level resource, so it requires a higher permission compared to deleting a deployment inside a namespace. One easy way to do this is to assign a cluster-admin role to the brigade service account, this is not recommended for production though.\nNow, when a PR is complete, our pipeline is triggered and it will delete the deployment and then the namespace.\nTo view the running jobs and their output, you can either use the brigade dashboard (called Kashti) by running brig dashboard or you can install the brigade terminal which will give you a similar UI but inside your favourite console.\nHere is the output from the PR job in the brigade terminal:\nIt shows that two jobs were executed in this build, and you can see the images that were used and the id of each job. To see the output of each job, just return into each job:\nHere you can see the the output of the helm job that deletes my helm deployment for the corresponding pull request.\nSummary I encourage you to take a look at Brigade, it’s easy to get started with and you can implement all sorts of automation without having to resort to other platforms and services. And although Javascript might put some people off, the power of a real programming language (compared to some DSL language) pays off when you want to implemtent something non-trivial.\nIf you already are using Kubernetes, why not use it for more things than your apps!\nThanks to my colleague Tobias Lolax (https://twitter.com/Tobibben) who did the original implementation of this for our customer.\nComments Imported from the original WordPress site. Closed for new replies.\nSarjana Informatika — 19 May 2026\nHow does Brigade use Docker containers and JavaScript to create and manage event-driven pipelines in Kubernetes?\n","permalink":"https://blog.ehn.nu/2020/01/event-driven-scripting-in-kubernetes-with-brigade/","summary":"\u003cp\u003eIn most projects that I’ve been part of, sooner or later the need for various types of automation jobs arises. For example cleaning up old files, moving database backups, running health checks or system tests and so on.\u003c/p\u003e\n\u003cp\u003eHistorically we’ve implemented these tasks using for example the Windows task scheduler, or through some custom Windows Service app. More recently, we’ve been using Azure Automation jobs for this. Sometimes it can also make sense to use CI/CD automation tools like Azure DevOps for these jobs.\u003c/p\u003e","title":"Event-driven scripting in Kubernetes with Brigade"},{"content":"When I set out my goals for 2019, one of them was to speak at new conferences. Up until 2018, I had only spoken at conferences in Sweden (like DevSum, TechDays and SweTugg). While these conferences are great, I felt that I wanted to raise the bar a bit and try to visit other conferences, including conferences abroad. And as it turned out, I reached my goal!\nI thought that it would be nice to sum up my speaking year in a blog post, with some comments about each comference and a picture or two.\nHowever I want to start this post by (once again) give a big shout out to my employer Active Solution. While I do spend a lot(!) of my spare time preparing talks and travelling to and from conferences, Active Solution is what makes all this possible by allowing me to use some of my work time for speaking and community related work, and for creating an environment at work where visiting conferences is a natural part of our core activities.\nActive Solution works very strategically with regards to developer conferences and meetups. We host a lot of different meetups at our office, and we also very often sponsor and/or exhibits at the three largest conferences for Microsoft/.NET developers in Sweden (DevSum, TechDays and SweTugg, see more about these conferences below). Doing this allows us to meet face to face with a lot of developers. We also have a group of people who have a passion for sharing their knowledge through public speaking, allowing us to share experiences with each other and give feedback on each others talks, CFP’s etc.\nA typical Active conference booth, with competitions and nice give aways\nLet’s walk through my speaking activities for 2019(not including several smaller meetup talks) for some highlights.\nWinOps 2018 London As you’ll note, this conference was actually at the end of 2018, but since it was my first conference abroad I’ll include it here 🙂\nWinOps is a two-day conference in London that focus on DevOps for Windows. There are a lot of DevOps conferences out there, but this is one of the few (if not the only one) with this focus. It’s not a very big conference, but I was very pleasantly surprised by the quality of the presentations that I saw, and the friendly atmosphere of the whole event.\nMy talk was about running Kubernetes in Azure, using Azure Kubernetes Service (AKS), and was very well received. You can tell from the questions afterwards if a talk was appreciated or not, in this case I had a lot of questions and interesting discussions afterwards.\nFor this conference I brought my 11-year old son Svante with me as company. He joined me for my session (not focusing too much on it though 🙂 ) and after the conference we stayed for two nights more in London and expored this fantastic city, where the christmas lights had just been lit up. Among other things we enjoyed a proper afternoon tea at the Dorchester hotel at Hyde Park.\nSvante in a nice WinOps t-shirt\nReady for some afternoon tea!\nNDC London Being accepted to an NDC conference has definitely been on my bucket list for some time, and finally it happened. NDC London accepted my talk “A Lap around Azure DevOps” which is basically an hour of demos, where I try to show as much as possible how team can be more productive with Azure DevOps. Unfortunately I had some network problems, so some demoes were a bit slow but I think that overall the talk was well received and I managed to finish all the demos within the hour.\nHere is a link to the recording of this session:\nhttps://www.youtube.com/watch?v=N78NxZ-cKUc\nNDC is well known for organizing great conferences and taking care of their attendees and speakers. I enjoyed hanging out with the other speakers during the conference.\nMVP Summit (Seattle) So, the MVP Summit is a special conference in this context since it’s not really about presenting anything but instead meeting with the product teams at Microsoft and learn and discuss current and future investments and roadmaps together with them and all the other MVP\u0026rsquo;s from around the world.\nHowever, I did do a short presentation during the “MVP2MVP day” which is a long tradition of the ALM/DevOps MVP group, where we meet on the sunday before the summit begins, and share knowledge with each other in a packed day. Typically there are 20 minute sessions going on from 10AM to 5PM with a short lunch break, and is great fun. A big kudos here to Brian Randall and Neno Loje who are the master minds behind this day!\nAlthough my MVP award was recently moved from the ALM category to the Azure category, I’m still hanging out with this amazing group of people that I’ve come to know through my 8 years of being an MVP.\nCelebrating TFS (mow Azure DevOps) on it’s 13th birthday 🙂\nDuring the summit I had my avatar drawn live with the one and only @reverentgeek (David Neal)\nDevSum (Stockholm) DevSum is the biggest .NET conference in Sweden, and 2019 was my 5th year in a row to speak at this conference. Active solution has been a proud sponsor at this event and we always have a nice booth where we try to combine cutting edge technologies with some fun competitions!\nThis time, I did my “A Lap around Azure DevOps” talk again. It’s always nice to deliver a session more that once, it allows me to refine the presentation and make it a little bit better than last time.\nOf course, things are changing so every time I redeliver a talk I end up changing both slides and demos in order to incorporate new things. This time I had no Internet problems so all the demos went as planned!\nIgnite Tour Stockholm 208/2019 saw the first edition of Ignite The Tour running around the world. Microsoft took their big Ignite conference in tour, together with speakers from Microsoft and also local community speakers on each location. I submitted a couple of talks to Ignite Tour in Stockholm and got two talks accepted:\n**Continuous Delivery with Azure Kubernetes Service**In this talk I showed how to implemented CD techniques like A/B and Canary testing using Kubernetes and AKS.\n**Keeping your builds green using Docker**This talk was based on work that I’ve been doing for my current customes during the last year, where we have used Docker as the basis for the build environment. Instead of relying on manually patched servers with flaky behaviour, we moved everything to Docker which gives as Infrastructure as code and full isolation which is great when you want to have fully repeatable builds. I also talked about and showed how you can use Docker for building your applications, which has several advantages.\nTalking about Kubernetes and AKS\nUsing Docker for build automation\nNDC Sydney Without a doubt, the biggest thing for me last year was being accepted to NDC Sydney. Travelling to Australia is something that I always wanted to do, so having this opportunity was nothing but amazing. Of course, trafelling to Sydney from Stockholm is a VERY long trip, so I made sure to add some vacation before and after the conference so that I was able to explore the beatiful city of Sydney.\nOf course, following the news on the fires in Australia and around Sydney these last couple of months has been very painful to watch, probably even more so since I visited it so recently.\nAt the conference, I delivered once again delivered the “Keeping your builds green using Docker” talk, which went very well.\nHere is a link to the recording:\nhttps://www.youtube.com/watch?v=ekNSwDS1ya4\nVisiting friend and fellow MVP Adam Cogan and his wife Anastasia over at Coogee beach\nA mandatory shot of the Opera house in the Sydney harbour\nRegistration opens at NDC, which\nHeather Downing opened the conference with a keynote on how to treat and motivate your software engineers\nThe (in)famous PubConf was held on friday night after the NDC conference ended\nBeautiful night skyline of Sydney\nTechDays Sweden Another big Microsoft conference in Sweden is TechDays Sweden, which celebrated 10 years in 2019. TechDays is a big conference with almost 2000 participants. Usually there is around 10 different tracks with a mixture of IT/Operations and Developer tracks.\nThis time, I coordinated a bit with my colleague Chris Klug (@zerokoll). Since we are both working with and speaking a lot about Docker and Kubernetes, we decided to make sure that our sessions didn’t overlap but instead built on each other. So Chris did a session that introduced Kubernetes for developers, and I did a session about “DevOps with Azure Kubernetes Service”, where I showed how to setup a CI/CD pipeline, how to make sure that your AKS cluster and applications are secure , compliant and highly available.\nWaiting for everyone to take their seat\nUpdateConf (Prague) The Czech Republic is a country that I had never visited before, so I was very glad when I was accepted to speak at this conference in Prague. Unfortunately, as it turned I had to rearrange my travels a bit so I didn’t really have any time to visit the city so I sure hope to come back again!\nAt UpdateConf, I delivered a new session that is called “Event-driven computing with Kubernetes”, where I talk about some open source tooling that let’s you implement event-based automation and scaling, Brigade and Keda.\nMy colleague Cecilia Wiren (@ceciliasharp) about to start one of her sessions\nMe speaking about Brigade and Keda\nAction pic 🙂\nCloudBrew (Mechelen, Belgium) The last conference of the year for me was CloudBrew. I have heard so many good things about this community conference over the years so I was naturally thrilled when I was accepted to speak at this conference. And all the good things I heard turned out to be true, or better. The conference has grown a lot over the years, this year there were around 400 attendees which was twice as much as the year before. The crew from the Belgian Azure user group (AZUG) does an amazing job with this conference, everything worked flawlessly and I met a lot of new people at this conference, all with a passion for Azure in common.\nI delivered the session about event-driven computing with Kubernetes again, this time with no other than Clemens Vasters in the audience, who of course is the father of the Messaging services in Azure. He has recently been involved in the work around Keda and cloud events which I covered in this talk.\nAlex Mangs opened the conference with a keynote looking at the future of Azure\nTime to talk about Brigade and Keda again\nMy colleague Alan Smith preparing for his session\nA great speaker dinner with both old a new friends\nSummary From a speaker perspective 2019 was an amazing year where I experienced so much and met so many new people. I can only hope that 2020 will bring some of the same experiences for me.\nAs with everything else, the more you prepare and speak at conferences the better you will become. For me, public speaking doesn\u0026rsquo;t really come naturally but I do feel that I have improved it over the years.\nI keep my list of upcoming (and past) speaking engagements updated here:\nhttps://blog.ehn.nu/speaking/\nHope to see you at a conference soon!\n","permalink":"https://blog.ehn.nu/2020/01/my-speaking-year-2019/","summary":"\u003cp\u003eWhen I set out my goals for 2019, one of them was to speak at new conferences. Up until 2018, I had only spoken at conferences in Sweden (like DevSum, TechDays and SweTugg). While these conferences are great, I felt that I wanted to raise the bar a bit and try to visit other conferences, including conferences abroad. And as it turned out, I reached my goal!\u003c/p\u003e\n\u003cp\u003eI thought that it would be nice to sum up my speaking year in a blog post, with some comments about each comference and a picture or two.\u003c/p\u003e","title":"My Speaking Year 2019"},{"content":"Many of us have eagerly been waiting for the announcement that Microsoft made at the Build 2019 conference, Windows Containers is now in public preview in Azure Kubernetes Service! Yes, it’s in preview so we still have to wait before putting applications into production but it is definitely time to start planning and testing migrations of your Windows applications to AKS, such as full .NET Framework apps.\nContainers on Windows are still not as mature as on Linux of course, but they are fully supported on Windows and it is now GA on Kubernetes since version 1.14.\nNB: Read about the current limitations for Windows Server nodes pools and application workloads in AKS here https://docs.microsoft.com/en-us//azure/aks/windows-node-limitations\nIn this introductory post, I will show how to create a new AKS cluster with a Windows node and then deploy an application to the cluster using Helm.\nEnabling AKS Preview Features If AKS is still in preview when you are reading this, you first need to enable the preview features before you can create a cluster with Windows nodes:\naz extension add –name aks-preview\naz feature register –name WindowsPreview –namespace Microsoft.ContainerService\nThe operation will take a while until it is completed, you can check the status by running the following command:\naz feature list -o table \u0026ndash;query \u0026ldquo;[?contains(name, \u0026lsquo;Microsoft.ContainerService/WindowsPreview\u0026rsquo;)].{Name:name,State:properties.state}\u0026rdquo;\nWhen the registration state is Registered, run the following command to refresh it:\naz provider register \u0026ndash;namespace Microsoft.ContainerService\\\nCreating an AKS Cluster with Windows nodes When the registration of the preview feature have been completed, you can go ahead and create a cluster. Here, I’m creating a 1 node cluster since it will only be used for demo purposes. Note that it is currently not possible to create an all Windows node cluster, you have to create at least one Linux node. It is also necessary to use a network policy that uses Azure CNI .\nThe below command creates a one node cluster with the Azure CNI network policy, and specifies the credentials for the Windows nodesm, should you need to login to these machines. Replace \u0026lt;MY_PASSWORD\u0026gt; with your own strong password.\n(Note that the commands below is executed in a Bash shell):\naz group create \u0026ndash;name k8s \u0026ndash;location westeurope\naz aks create \\ --resource-group k8s \\ --name k8s \\ --node-count 1 \\ --enable-addons monitoring \\ --kubernetes-version 1.14.0 \\ --generate-ssh-keys \\ --windows-admin-password \u0026lt;MY_PASSWORD\u0026gt; \\ --windows-admin-username azureuser \\ --enable-vmss \\ --network-plugin azure Now we will add a new node pool that will host our Windows nodes. for that, we use the new az aks nodepool add command. Note the os-type parameter that dictates that this node pool will be used for Windows nodes.\naz aks nodepool add \\ \u0026ndash;resource-group k8s \\ \u0026ndash;cluster-name k8s \\ \u0026ndash;os-type Windows \\ \u0026ndash;name npwin \\ \u0026ndash;node-count 1 \\ \u0026ndash;kubernetes-version 1.14.0\nWhen the command has completes, you should see two nodes in your cluster: kubectl get nodes\nNAME STATUS ROLES AGE VERSION\naks-nodepool1-15123610-vmss000000 Ready agent 8d v1.14.0\naksnpwin000000 Ready agent 8d v1.14.0\nInstalling Helm Even though Helm has it’s quirks, I find it very useful for packaging and deploying kubernetes applications. A new major version is currently being worked on, which will (hopefully) remove some of the major issues that exists in the current version of Helm.\nSince Helm is not installed in a AKS cluster by default, we need to install it. Start by installing theHelm CLI, follow the instructions here for your platform:\nhttps://helm.sh/docs/using_helm/#installing-helm\nBefore deploying Helm, we need to create a service account with proper permissions that will be used by Helms server components, called Tiller. Create the following file:\nhelm-rbac.yaml apiVersion: v1 kind: ServiceAccount metadata: name: tiller namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: tiller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: tiller namespace: kube-system Run the following command to create the service account and the cluster role binding:\nkubectl apply –f helm-rbac.yaml\nTo deploy helm to the AKS cluster, we use the helm init command. To make sure that it ends up on a Linux node, we use the –node-selectors parameter:\nhelm init \u0026ndash;service-account tiller \u0026ndash;node-selectors \u0026ldquo;beta.kubernetes.io/os=linux\u0026rdquo;\nRunning helm list should just return an empty list of releases, to make sure that Helm is working properly.\\\nDeploy an Application Now we have an AKS cluster up and running with Helm installed, let’s deploy an application. I will once again use the QuizBox application that me and Mathias Olausson developed for demos at conferences and workshops. To simplify the process, I have pushed the necessary images to DockerHub which means you can deploy them directly to your cluster to try this out.\nThe source code for the Helm chart and the application is available here: https://github.com/jakobehn/QBox\nLet’s look at the interesting parts in the Helm chart. First up is the deployment of the web application. Since we are using Helm charts, we will pick the values from a separate values.yaml file at deployment time, and refer to them using the {{expression}} format.\nNote also that we using the nodeSelector property here to specify that the pod should be deployed to a Windows node.\ndeployment-frontend.yaml\napiVersion: apps/v1beta1 kind: Deployment metadata: name: frontend spec: replicas: {{ .Values.frontend.replicas }} template: metadata: labels: app: qbox tier: frontend spec: containers: - name: frontend image: \u0026#34;{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}\u0026#34; ports: - containerPort: {{ .Values.frontend.containerPort }} nodeSelector: \u0026#34;beta.kubernetes.io/os\u0026#34;: windows The deployment file for the backend API is pretty much identical:\ndeployment-backend.yaml\napiVersion: apps/v1beta1 kind: Deployment metadata: name: backend spec: replicas: {{ .Values.backend.replicas }} template: metadata: labels: tier: backend spec: containers: - name: backend image: \u0026#34;{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}\u0026#34; ports: - containerPort: {{ .Values.backend.containerPort }} nodeSelector: \u0026#34;beta.kubernetes.io/os\u0026#34;: windows Finally, we have the database. Here I am using SQL Server Express on Linux, mainly because there is no officially supported Docker image from Microsoft that will run on Windows Server 2019 (which is required by AKS, since it’s running Windows nodes on Windows Server 2019).\nBut this also hightlights a very interesting and powerful feature of Kubernetes and AKS, the ability to mix Windows and Linux nodes in the same cluster and even within the same applications! This means that the whole ecosystem of Linux container images is available for Windows developers as well.\ndeployment-db.yaml\napiVersion: apps/v1beta1 kind: Deployment metadata: name: db spec: replicas: {{ .Values.db.replicas }} template: metadata: labels: tier: db spec: containers: - name: db image: \u0026#34;{{ .Values.db.image.repository }}:{{ .Values.db.image.tag }}\u0026#34; ports: - containerPort: {{ .Values.db.containerPort }} env: - name: ACCEPT_EULA value: \u0026#34;Y\u0026#34; - name: SA_PASSWORD valueFrom: secretKeyRef: name: db-storage key: password nodeSelector: \u0026#34;beta.kubernetes.io/os\u0026#34;: linux To deploy the application, navigate to the root directory of the helm chart (where the Values.yaml file is located) and run:\nhelm upgrade \u0026ndash;install quizbox . \u0026ndash;values .\\values.yaml\nThis will build and deploy the Helm chart and name the release “quizbox”. Running helm status quizbox shows the status of the deployment:\nhelm status quizbox\nLAST DEPLOYED: Fri Jun 28 14:52:15 2019 NAMESPACE: default STATUS: DEPLOYED RESOURCES:\n==\u0026gt; v1beta1/Deployment\nNAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE\nbackend 1 1 1 0 9s\ndb 1 1 1 1 9s\nfrontend 1 1 1 0 9s\n==\u0026gt; v1/Pod(related)\nNAME READY STATUS RESTARTS AGE\nbackend-69fd59c947-77tm4 0/1 ContainerCreating 0 9s\ndb-74dfcdcbff-79zsp 1/1 Running 0 9s\nfrontend-89d4b5b4b-rqw4q 0/1 ContainerCreating 0 9s\n==\u0026gt; v1/Secret\nNAME TYPE DATA AGE\ndb-storage Opaque 1 10s\n==\u0026gt; v1/Service\nNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\nqboxdb ClusterIP 10.0.153.253 1433/TCP 9s\nfrontend LoadBalancer 10.0.132.46 80:32608/TCP 9s\nqboxapi ClusterIP 10.0.235.72 80/TCP 9s\nNOTES:\nHelm chart for QuizBox deployed successfully!\nWait until the status of all pods are Running and until you see an EXTERNAL-IP address for the frontend service:\nOpen a browser and navigate to the exernal IP address, in a few seconds you should see the QuizBox application running:\nThis was a very simple walkthrough on how to get started with Windows applications on Azure Kubernetes Service. Hope you found it useful, and stay tuned for more blog posts on AKS and Windows in the near future!\n","permalink":"https://blog.ehn.nu/2019/06/getting-started-with-windows-containers-in-azure-kubernetes-service/","summary":"\u003cp\u003eMany of us have eagerly been waiting for the announcement that Microsoft made at the Build 2019 conference, Windows Containers is now in public preview in Azure Kubernetes Service! Yes, it’s in preview so we still have to wait before putting applications into production but it is definitely time to start planning and testing migrations of your Windows applications to AKS, such as full .NET Framework apps.\u003c/p\u003e\n\u003cp\u003eContainers on Windows are still not as mature as on Linux of course, but they are fully supported on Windows and it is now GA on Kubernetes since version 1.14.\u003c/p\u003e","title":"Getting started with Windows Containers in Azure Kubernetes Service"},{"content":"In a previous post I talked about how to create a build environment, including an Azure DevOps build agent, using Docker and Windows Containers. Using Dockerfiles, we can specify everything that we need in order to build and test our projects. Docker gives us Infrastructure as Code (no more snowflake build servers) and isolation which makes it easy to spin up multiple agents quickly on one or more machines without interfering with each other.\nWhat I didn’t talk about in that post is to actually depoy and run the Windows containers in a production environment. I showed how to start the agent using docker run, but for running build agents for production workloads, you need something more stable and maintainable. There are also some additional aspects that you will need to handle when running build agents in containers.\nFor hosting and orchestrating Windows containers there are a few different options:\nUsing Docker Compose\\ Docker Swarm\\ Kubernetes (which recently announced General Availability for running Windows Containers) In this post I will show how to use Docker Compose to run the builds agents. In an upcoming post, I will use Azure Kubernetes services to run Windows container builds agents on multiple machines in the cloud (Support for Windows containers is currently in preview: https://docs.microsoft.com/en-us/azure/aks/windows-container-cli).\nIn addition to selecting the container hosting, there are some details that we want to get right:\nExternalize build agent working directory\nWe want to make sure that the working directory of the build agents is mapped to outside of the container. Otherwise we will loose all state when an agent is restarted, making all subsequent builds slower\\ Enable “Docker in docker”\nOf course we want our build agent to be able to build Dockerfiles. While it is technically possible to install and run Docker engine inside a Docker container, it is not recommended. Instead, we install the Docker CLI in the container and use Named Pipes to bind the Docker API from the host. That means that all containers running on the host will share the same Docker engine. An advantage of this is that they will all benefit from the Docker image and build cache, improving build times overall, and reducing the amount of disk space needed\\ Identity\nWhen accessing resources outside the container, the build agent will almost always need to authenticate against that resource. This could be for example a custom NuGet feed, or a network share. A Windows container can’t be domain joined, but we can use group Managed Service Accounts (gMSA) which is a special type of service account introduced in Windows Server 2012 designed to allow multiple computers to share an identity without needing to know its password.\nYou can follow this post from Microsoft on how to create and use group Managed Service Accounts for Windows containers:\nhttps://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/manage-serviceaccounts\nThis post assumes that you have created a gMSA called msa_BuildAgent . Docker Compose Docker compose makes it easy to start and stop multiple containers on a single host. All information is defined in a docker-compose.yml file, and then we can start everything using a simple docker-compose up command, and then docker-compose down to stop all containers, tearing down networks and so on.\nWe need to send in multiple parameters when starting the build agent containers, and to avoid making the docker-compose file too complex, we can extract all parameters to an external file. This also makes it easy to tokenize it when we run this from an automated process.\n**\ndocker-compose.yml\\\nversion: \u0026#39;2.4\u0026#39; services: agent1: image: ${IMAGE}:${VERSION} volumes: - type: npipe source: \\\\.\\pipe\\docker_engine target: \\\\.\\pipe\\docker_engine - type: bind source: d:\\w\\${WORKFOLDERNAME}1 target: c:\\setup\\_work env_file: .env environment: TFS_AGENT_NAME: ${AGENTNAME}-1 restart: always agent2: image: ${IMAGE}:${VERSION} volumes: - type: npipe source: \\\\.\\pipe\\docker_engine target: \\\\.\\pipe\\docker_engine - type: bind source: d:\\w\\${WORKFOLDERNAME}2 target: c:\\agent\\_work env_file: .env environment: TFS_AGENT_NAME: ${AGENTNAME}-2 restart: always As you can see, this file defines two containers (agent1 and agent2), you can easily add more here if you want to.\nSome comments on this file:\nTo enable “Docker in Docker”, we use the volume mapping of type npipe, which stands for named pipes. This binds to the Docker API running on the host\\ An addition volume is defined that maps c:\\agent_work to the defined path on the container host\\ We specify restart: always to make sure that these containers are restarted in case the build server is restarted All values for the variables will be taken from an environment file (the env_file argument), that looks like this:\n.env (env_file)\nTFS_URL=\u0026lt;ORGANIZATIONURL\u0026gt; TFS_PAT=\u0026lt;PERSONALACCESSTOKEN\u0026gt; TFS_POOL_NAME=\u0026lt;AGENTPOOLNAME\u0026gt; IMAGE=\u0026lt;BUILAGENTIMAGENAME\u0026gt; VERSION=\u0026lt;BUILDAGENTIMAGETAG\u0026gt; AGENTNAME=\u0026lt;CONTAINERNAME\u0026gt; WORKFOLDERNAME=\u0026lt;WORKFOLDERNAME\u0026gt; CREDENTIALSPEC=file://msa_BuildAgent.json This file is placed in the same folder as the docker-compose.yml file.\nMost of these parameters were covered in the previous post, the new ones here though are:\\\nWORKFOLDERNAME\nThis is the path on the container host where the working directory should be mapped to. Internally in the container, the work directory in the agent is set to c:\\agent_work\\ CREDENTIALSPEC\nThis is the name of the credential specification file that you created if you followed the post that I linked to above, when creating the group Managed Service Account. That file is placed in the c:\\ProgramData\\Docker\\CredentialSpec folder on your host To start these build agents you simply run the following command in the same directory where you places the docker-compose.yml and the .env files:\ndocker-compose up –d\nWhen you run this command, you will see something like:\nCreating network \u0026ldquo;build_default\u0026rdquo; with the default driver\nCreating build_agent1_1 \u0026hellip; Creating build_agent2_1 \u0026hellip; Creating build_agent1_1 \u0026hellip; done\nCreating build_agent2_1 \u0026hellip; done\nTo stop all the containers, including tearing down the network that was created you run :\ndocker-compose down\nAutomating the process The process of deploying and updating builds agent containers on a server should of course be automated. So we need something that runs on our build servers that can pull the build agent container images from a container registry, and then start the agents on that machine.\nOne way to do this with Azure DevOps is to use Deployment Groups, which let you run deployments on multiple machines either sequentially or in parallell.\nHere is an image that shows what this could look like:\nHere I have two build servers running Windows Server 2019 Core. The only things that are installed on these servers are Docker, Docker Compose and a Deployment Group agent. The deployment group agent will be used to stop the build agent containers, pull a new verison of the build agent image and then start them up again.\nHere is the deployment process in Azure Pipelines:\nThe process work like this:\nThe image version is updating by modifying the .env file that we defined before with the build number of the current build\\ We run Docker login to authenticate to the container registry where we have the build agent container image. In this case we are using Azure Container Reigstry, but any registry will do\\ The new version of the image is then pulled from the registry. This can take a while (Windows Containers are big) but usually only a few small layers need to be pulled after you have pulled the initial image the first time\\ When we have the new image locally, we shut down the agents by running *docker-compose down\n* And finally, we start the agents up again by running docker-compose up –d Deployment groups are powerful in that they let you specify how to roll out new deployments oacross multiple servers.\nIf you do not want to restart all of your build agents at the same time, you can specify thise in the settings of the deployment group job:\nNote: One thing that is not handled by this process is graceful shutdown, e.g. if a build is currently running it will be stopped when shutting down the agents. It would be fully possible to utilize the Azure Pipelines API to first disable all agents (to prevent new builds from starting) and then wat until any currently running builds have finished, before shutting them down. I just haven’t done that yet 🙂\nHopefully this post was helpful if you want to run Windoes Continaer build agents for Azure Pipelines on your servers!\n","permalink":"https://blog.ehn.nu/2019/06/running-windows-container-build-agents-for-azure-pipelines/","summary":"\u003cp\u003eIn \u003ca href=\"/2019/01/creating-a-windows-container-build-agent-for-azure-pipelines/\"\u003ea previous post\u003c/a\u003e I talked about how to create a build environment, including an Azure DevOps build agent, using Docker and Windows Containers. Using Dockerfiles, we can specify everything that we need in order to build and test our projects. Docker gives us Infrastructure as Code (no more snowflake build servers) and isolation which makes it easy to spin up multiple agents quickly on one or more machines without interfering with each other.\u003c/p\u003e","title":"Running Windows Container Build Agents for Azure Pipelines"},{"content":"I’ve recently given talks at conferences and user groups on the topic of using Docker as a build engine, describing the builds using a Dockerfile. This has several advantages, such as fully consistent build no matter where you run it, no dependencies necessary except Docker.\nSome things become a bit tricker though, I’ve blogged previously about how to run unit tests in a Docker build, including getting the test results out of the build container afterwards.\nAnother thing that you will soon hit if you start with Dockerfile builds, is how to restore packages from an authenticated NuGet feed, such as Azure Artifacts. The reason this is problematic is that the build will run inside a docker container, as a Docker user that can’t authenticate to anything by default. If you build a projects that references a package located in an Azure Artifacts feed, you’ll get an error like this:\nStep 4/15 : RUN dotnet restore -s \u0026#34;https://pkgs.dev.azure.com/jakob/_packaging/DockerBuilds/nuget/v3/index.json\u0026#34; -s \u0026#34;https://api.nuget.org/v3/index.json\u0026#34; \u0026#34;WebApplication1/WebApplication1.csproj\u0026#34; ---\u0026gt; Running in 7071b05e2065 /usr/share/dotnet/sdk/2.2.202/NuGet.targets(119,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/jakob/_packaging/DockerBuilds/nuget/v3/index.json. [/src/WebApplication1/WebApplication1.csproj] /usr/share/dotnet/sdk/2.2.202/NuGet.targets(119,5): error : Response status code does not indicate success: 401 (Unauthorized). [/src/WebApplication1/WebApplication1.csproj] The command \u0026#39;/bin/sh -c dotnet restore -s \u0026#34;https://pkgs.dev.azure.com/jakob/_packaging/DockerBuilds/nuget/v3/index.json\u0026#34; -s \u0026#34;https://api.nuget.org/v3/index.json\u0026#34; \u0026#34;WebApplication1/WebApplication1.csproj\u0026#34;\u0026#39; returned a non-zero code: 1 The output log above shows a 401 (Unauthorized) when we run a dotnet restore command.\nUsing the Azure Artifacts Credential Provider in a Dockerfile To solve this, Microsoft supplies a credential provider for Azure Artifacts, that you can find here https://github.com/microsoft/artifacts-credprovider\nNuGet wil look for installed credential providers and, depending on context, either prompt the user for credentials and store it in the credential manager of the current OS, or for CI scenarios we need to pass in the necessary informtion and the credential provider will then automatically do the authentication.\nTo use the credential provider in a Dockerfile build, you need to download and configure it, and also be sure to specify the feed when you restore your projects. Here is snippet from a Dockerfile that does just this:\\\nNB: The full source code is available here https://dev.azure.com/jakob/dockerbuilds/_git/DockerBuilds?path=%2F4.%20NugetRestore\u0026amp;version=GBmaster\nInstall Credential Provider and set env variables to enable Nuget restore with auth ARG PAT\nRUN wget -qO- https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash\nENV NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED true\nENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS \u0026ldquo;{\u0026quot;endpointCredentials\u0026quot;: [{\u0026quot;endpoint\u0026quot;:\u0026quot;https://pkgs.dev.azure.com/jakob/_packaging/DockerBuilds/nuget/v3/index.json\u0026quot;, \u0026quot;password\u0026quot;:\u0026quot;${PAT}\u0026quot;}]}\u0026rdquo;\nRestore packages using authenticated feed\\ COPY [\u0026ldquo;WebApplication1/WebApplication1.csproj\u0026rdquo;, \u0026ldquo;WebApplication1/\u0026rdquo;]\nRUN dotnet restore -s \u0026ldquo;https://pkgs.dev.azure.com/jakob/_packaging/DockerBuilds/nuget/v3/index.json\u0026quot; -s \u0026ldquo;https://api.nuget.org/v3/index.json\u0026quot; \u0026ldquo;WebApplication1/WebApplication1.csproj\u0026rdquo;\\\nThe VSS_NUGET_EXTERNAL_FEED_ENDPOINTS is an environment variable that should contain the endpoint credentials for any feed that you need to authenticate against, in a JSON Format. The personal access token is sent to the Dockerfile build using an argument called PAT.\nTo build this, create a Personal Access Token in your Azure DevOps account, with permissions to read your feeds, then run the following command:\\\ndocker build -f WebApplication1\\Dockerfile -t meetup/demo4 . \u0026ndash;build-arg PAT=\nYou should now see the restore complete successfully\nComments Imported from the original WordPress site. Closed for new replies.\nGabriel — 19 Sep 2019\nWhat happens after the token expires? Will my pipeline fail to build?\njakob — 17 Jan 2020\nYes. But instead of sending in an self generated token, you can use the $(System.AccessToken) variable in Azure Pipelines.\nSee this blogpost about how to enable this token and how to use it:\nhttps://toonvanhoutte.wordpress.com/2018/12/04/authenticate-azure-devops-against-its-own-rest-api/\n/Jakob\nIan — 20 Sep 2019\nReally helpful. Saved me some time. Thanks for posting\njakob — 17 Jan 2020\nThanks for reading :-)\nTamas — 28 Nov 2019\nHi!\nI am getting a 401 for the given link: https://dev.azure.com/jakob/ignitetour/_git/DockerBuilds?path=%2F4.%20NugetRestore\u0026amp;version=GBmaster\njakob — 17 Jan 2020\nSorry, I\u0026rsquo;ve fixed the link now\nJasper Siegmund — 23 Dec 2019\nThe links mentioned bring me to a \u0026ldquo;401 - Uh-oh, you do not have access.\u0026rdquo;\ndpetrizze — 25 Nov 2020\nAfter following this format, rather than getting a 401, I\u0026rsquo;m getting a 403 error, \u0026ldquo;The requested operation is not allowed\u0026rdquo;.\nI was able to duplicate the 403 error by issuing a dotnet restore locally in WSL2. I then added the \u0026ndash;interactive option and was given the prompt to authenticate with a devicelogin code which (I believe) creates a SessionTokenCache on the local system. After following the steps, the 403 went away and I was able to restore successfully in WSL2.\nUnfortunately, \u0026ndash;interactive in a docker build does not work.\nDo you have any experience with 403 and docker builds? Any ideas how to achieve a similar session token cache for docker builds?\nRamesh — 23 Sep 2021\nThanks for above. Is there any reference for how to access/copy maven package from azure artifacts feed in a Docker image using a dockerfile?\n","permalink":"https://blog.ehn.nu/2019/05/accessing-azure-artifacts-feed-in-a-docker-build/","summary":"\u003cp\u003eI’ve recently given talks at conferences and user groups on the topic of using Docker as a build engine, describing the builds using a Dockerfile. This has several advantages, such as fully consistent build no matter where you run it, no dependencies necessary except Docker.\u003c/p\u003e\n\u003cp\u003e\u003cimg alt=\"Image result for docker\" loading=\"lazy\" src=\"https://www.docker.com/sites/default/files/social/docker_facebook_share.png\"\u003e\u003c/p\u003e\n\u003cp\u003eSome things become a bit tricker though, \u003ca href=\"/2019/01/running-net-core-unit-tests-with-docker-and-azure-pipelines/\"\u003eI’ve blogged previously\u003c/a\u003e about how to run unit tests in a Docker build, including getting the test results out of the build container afterwards.\u003c/p\u003e","title":"Accessing Azure Artifacts feed in a Docker build"},{"content":"Having automated builds that are stable and predictable is so important in order to succeed with CI/CD. One important practice to enable this is to have a fully scriptable build environment that lets you deploy multiple, identical, build envionment hosts. This can be done by using image tooling such as Packer from HahsiCorp. Another option is to use Docker which is what I am using in this post.\nUsing Docker will will crete a Dockerfile that specifies the content of the image in which builds will run. This image should contain the SDK’s and tooling necessary to build and test your projects. It will also contain the build agent for your favourite CI server that will let you spin up a new agent in seconds using the docker image.\nIn this post I will walk you through how to create a Windows container image for Azure Pipelines/Azure DevOps Server that contains the necessary build tools for building .NET Framework and .NET Core projects.\nI am using Windows containers here because I want to be able to build full .NET Framework projects (in addition to .NET core of course). If you only use .NET Core things are much simpler, there is even an existing Docker image from Microsoft thath contains the build agent here: https://hub.docker.com/r/microsoft/vsts-agent/\nAll files referred to in this blog post are available over at GitHub:\nhttps://github.com/jakobehn/WindowsContainerBuildImage\nPrerequisites:\nYou need to have Docker Desktop install on your machine to build the image.\nI also recommend using Visual Studio Code with the Docker extension installed for authoring Dockerfiles (see https://code.visualstudio.com/docs/azure/docker)\nSpecifying the base image All Docker images must inherit from a base image. In this case we will start with one of the images from Microsoft that ships with the full .NET Framework SDK, microsoft/dotnet-framework.\nIf you have the Docker extension in VS Code installed, you can browse existing images and tags directly from the editor:\nI’m going to use the image with .NET Framework 4.7.2 SDK installed running in Windows Server Core:\nInstalling Visual Studio Build Tools In order to build .NET Framework apps we need to have the proper build tools installed. Installing Visual Studio in a Docker container is possible but not recommended. Instead we can install Visual Studio Build Tools, and select wich components to install.\\\nTo understand which components that are available and which identifer they have, this page is very userful. It contains all available components that you can install in Visual Studio Build Tools 2017:\nhttps://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2017\nIn the lines shown below, I’m first downloading and installing Visual Studio Log Collection tool (vscollect) that let’s us capture the installation log. Then we download the build tools from the Visual Studio 2017 release channel feed.\nFinally we are instaling the build tools in quiet mode,specifying the desired components. Of course you might wamt to change this list to fit your needs.\nInstalling additional tooling You will most likely want to install additional tooling, besides the standard VS build tools. In my case, I want to install Node, the latest version of NET Core SDK and also web deploy. Many of these things can be installed easily using chocolatey, as shown below:\nInstalling .NET Core SDK can be done by simply downloading it and extract it and update the PATH environment variable:\nInstalling and configuring the Azure Pipelines Build Agent Finally we want to installl the Azure Pipelines build agent and configure it. Installing the agent will be done when we are building the Docker image. Configuring it against your Azure DevOps organization must be done when starting the image, which means will do this in the CMD part of the Dockerfile, and supply the necessary parameters.\nThe InstallAgent.ps1 script simply extracts the downloaded agent :\nConfigureAgent.ps1 will be executed when the container is started, and here we are using the unattended install option for the Azure Pipelines agent to configure it against an Azure DevOps organization:\nBuilding the Docker image To build the image from the Dockerfile, run the following command:\ndocker build -t mybuildagent:1.0 -m 8GB .\nI’m allocating 8GB of memory here to make sure the installation process won’t be too slow. In particular installing the build tools is pretty slow (around 20 minutes on my machine) and I’ve found that allocating more memory speeds it up a bit. As always, Docker caches all image layers so if you make a change to the Docker file, the build will go much faster the next time (unless you change the command that installs the build tools 🙂\nWhen the build is done you can run docker images to see your image.\nRunning the build agent To start the image and connect it to your Azure DevOps organization, run the following command:\ndocker run -d -m 4GB \u0026ndash;name \u0026ndash;storage-opt \u0026ldquo;size=100GB\u0026rdquo; -e TFS_URL=-e TFS_PAT= -e TFS_POOL_NAME= -e TFS_AGENT_NAME= mybuildagent:1.0\nReplace the parameters in the above string:\n**NAME**Name of the builds agent as it is registered in the build pool in Azure DevOps. Also the docker container will use the same name, which can be handy whe you are running multiple agents on the same host **ORGANIZATIONURL**URL to your Azure DevOps account, e.g. https://dev.azure.com/contoso **PAT**A personal access token that you need to crete in your Azure DevOps organization Make sure that the token has the AgentPools (read, manage) scope enabled **POOL**The name of the agent pool in Azure DevOps that the agent should register in When you run the agent from command line you will see the id of the started Docker container. For troubleshooting you can run docker logs to see the output from the build agent running in the container\nAfter around 30 seconds or so, you should see the agent appear in the list of available agents in your agent pool:\nHappy building!\nComments Imported from the original WordPress site. Closed for new replies.\nJames — 19 Jan 2019\nI can\u0026rsquo;t wait to try this out. This has been on a list of things I wanted todo (Windows Container, Full .NET Framework Agents) for a while. Thanks.\nVinay — 22 May 2020\nHi,\nJust wanted to know what edition of windows we need to try out this agent container building\ncould you please respond ASAP\nBurton — 17 Nov 2020\n+1M Thanks so much! Even today, MS hasn\u0026rsquo;t published a Windows container (that I can find) of their Windows hosted agents \u0026ndash; if anyone knows of the image please share. I want to add a few tools and capture the state after a nightly build to enable incremental scenarios to speed up horridly long build times in CI.\n","permalink":"https://blog.ehn.nu/2019/01/creating-a-windows-container-build-agent-for-azure-pipelines/","summary":"\u003cp\u003eHaving automated builds that are stable and predictable is so important in order to succeed with CI/CD. One important practice to enable this is to have a fully scriptable build environment that lets you deploy multiple, identical, build envionment hosts. This can be done by using image tooling such as Packer from HahsiCorp. Another option is to use Docker which is what I am using in this post.\u003c/p\u003e\n\u003cp\u003eUsing Docker will will crete a Dockerfile that specifies the content of the image in which builds will run. This image should contain the SDK’s and tooling necessary to build and test your projects. It will also contain the build agent for your favourite CI server that will let you spin up a new agent in seconds using the docker image.\u003c/p\u003e","title":"Creating a Windows Container Build Agent for Azure Pipelines"},{"content":"Using Docker containers for building and running your applications has many advantages such as consistent builds, build-once run anywhere and easy standardized packaging and deployment format, just to name a few.\nWhen it comes to running the containers you might look into container orchestrators such as Kubernetes or Docker Swarm. Sometimes though, these orchestrators can be overkill for your applications. If you are developing web applications that have only a few dependent runtime components, another options is to use Azure Web App for Containers, which is a mouthful for saying that you can use your beloved Azure Web Apps with all the functionality that comes with it (easy scaling, SSL support etc), but deploy your code in a container. Best of both worlds, perhaps?\nIn this post I will show how you can create an ARM template that creates the Azure Web App with the necessary setting to connect it to an Azure Container Registry, and how you setup a Azure Pipeline to build and deploy the container.\nThe code for this blog post is available on GitHub:\nhttps://github.com/jakobehn/containerwebapp\nThe release definition is available here:\nhttps://dev.azure.com/jakob/blog\nPrerequisites An Azure subscription (duh) An Azure Container Registry An Azure DevOps project Creating the ARM Template First up is creating an ARM template that will deploy the web app resource to your Azure subscription. Creating an ARM template for a web app is easy, you can use the Azure Resource Group project in Visual Studio (this template is installed with the Azure SDK) and select the Web app template:\n[](file:///C:/Users/jakobe/AppData/Local/Temp/OpenLiveWriter1510372289/supfiles126F4E9/image4.png)\nNow, we need to make some changes in order to deploy this web app as a container. FIrst of all we will change some settings of the App Service Plan.\nSet the “kind” property to “linux”, to specify that this is a Linux hosted web app (Windows containers for Web Apps are in preview at the moment).\nThen we also need to set the “reserved” property to **true (**The documentation just says: ‘If Linux app service plan true, false otherwise’ 🙂 )\n{ \u0026#34;apiVersion\u0026#34;: \u0026#34;2015-08-01\u0026#34;, \u0026#34;name\u0026#34;: \u0026#34;[parameters(\u0026#39;hostingPlanName\u0026#39;)]\u0026#34;, \u0026#34;type\u0026#34;: \u0026#34;Microsoft.Web/serverfarms\u0026#34;, \u0026#34;location\u0026#34;: \u0026#34;[resourceGroup().location]\u0026#34;, \u0026#34;kind\u0026#34;: \u0026#34;linux\u0026#34;, \u0026#34;tags\u0026#34;: { \u0026#34;displayName\u0026#34;: \u0026#34;HostingPlan\u0026#34; }, \u0026#34;sku\u0026#34;: { \u0026#34;name\u0026#34;: \u0026#34;[parameters(\u0026#39;skuName\u0026#39;)]\u0026#34;, \u0026#34;capacity\u0026#34;: \u0026#34;[parameters(\u0026#39;skuCapacity\u0026#39;)]\u0026#34; }, \u0026#34;properties\u0026#34;: { \u0026#34;name\u0026#34;: \u0026#34;[parameters(\u0026#39;hostingPlanName\u0026#39;)]\u0026#34;, \u0026#34;reserved\u0026#34;: true } }, For the web app definition, we need to set the “kind” property to “app,linux,container” to make this a containerized web app resource. We also need to set the DOCKER_CUSTOM_IMAGE_NAME to something. We will set the correct image later on from our deployment pipeline, but this property must be here when we create the web app resource.\n{ \u0026#34;apiVersion\u0026#34;: \u0026#34;2015-08-01\u0026#34;, \u0026#34;name\u0026#34;: \u0026#34;[variables(\u0026#39;webSiteName\u0026#39;)]\u0026#34;, \u0026#34;type\u0026#34;: \u0026#34;Microsoft.Web/sites\u0026#34;, \u0026#34;kind\u0026#34;: \u0026#34;app,linux,container\u0026#34;, \u0026#34;location\u0026#34;: \u0026#34;[resourceGroup().location]\u0026#34;, \u0026#34;tags\u0026#34;: { \u0026#34;[concat(\u0026#39;hidden-related:\u0026#39;, resourceGroup().id, \u0026#39;/providers/Microsoft.Web/serverfarms/\u0026#39;, parameters(\u0026#39;hostingPlanName\u0026#39;))]\u0026#34;: \u0026#34;Resource\u0026#34;, \u0026#34;displayName\u0026#34;: \u0026#34;Website\u0026#34; }, \u0026#34;dependsOn\u0026#34;: [ \u0026#34;[resourceId(\u0026#39;Microsoft.Web/serverfarms/\u0026#39;, parameters(\u0026#39;hostingPlanName\u0026#39;))]\u0026#34; ], \u0026#34;properties\u0026#34;: { \u0026#34;name\u0026#34;: \u0026#34;[variables(\u0026#39;webSiteName\u0026#39;)]\u0026#34;, \u0026#34;serverFarmId\u0026#34;: \u0026#34;[resourceId(\u0026#39;Microsoft.Web/serverfarms\u0026#39;, parameters(\u0026#39;hostingPlanName\u0026#39;))]\u0026#34;, \u0026#34;siteConfig\u0026#34;: { \u0026#34;DOCKER_CUSTOM_IMAGE_NAME\u0026#34;: \u0026#34;containerwebapp\u0026#34; } } }, Again, the full source is available over att GitHub (see link at top)\nAzure Pipeline Let’s create a deployment pipeline that will build and push the image, and then deploy the ARM template and finally the web app container.\nFirst up is the build definition, here I’m using YAML since it let’s me store the build definition in source control together with the rest of the application:\nNB: You need to change the azureSubscriptionEndpoint and azureContainerRegistry to the name of your service endpoint and Azure container registry\n**\nazure-pipelines.yml\nname: 1.0$(rev:.r)\ntrigger:\n- master\npool:\nvmImage: \u0026lsquo;Ubuntu-16.04\u0026rsquo;\nsteps:\n- task: Docker@1\ndisplayName: \u0026lsquo;Build image\u0026rsquo;\ninputs:\nazureSubscriptionEndpoint: \u0026lsquo;Azure Sponsorship\u0026rsquo;\nazureContainerRegistry: jakob.azurecr.io\ndockerFile: ContainerWebApp/Dockerfile\nuseDefaultContext: false\nimageName: \u0026lsquo;containerwebapp:$(Build.BuildNumber)\u0026rsquo;\n- task: Docker@1\ndisplayName: \u0026lsquo;Push image\u0026rsquo;\ninputs:\nazureSubscriptionEndpoint: \u0026lsquo;Azure Sponsorship\u0026rsquo;\nazureContainerRegistry: jakob.azurecr.io\ncommand: \u0026lsquo;Push an image\u0026rsquo;\nimageName: \u0026lsquo;containerwebapp:$(Build.BuildNumber)\u0026rsquo;\n- task: PublishBuildArtifacts@1\ndisplayName: \u0026lsquo;Publish ARM template\u0026rsquo;\ninputs:\nPathtoPublish: \u0026lsquo;ContainerWebApp.ResourceGroup\u0026rsquo;\nArtifactName: template\nThe build definition performs the following steps:\nBuild the container image using the Docker task, where we point to the Dockerfile and give it an imagename\\ Pushes the container image to Azure Container Registry\\ Publishes the content of the Azure resource group project back to Azure Pipelines. This will be used when we deploy the resource group in the release definition Running this buid should push an image to your container registry.\nNow we will create a release definition that deployes the resource group and then the container web app.\nFirst up is the resource group deployment. Here we use the Azure Resource Group Deployment task, where we point to the ARM template json file and the parameters file. We also override the name of the app hosting plan since that is an input parameter to the template.\nThen we use the Azure App Service Deployment task to deploy the container to the web app. Note that we are using the preview 4.* version since that has support for deploying to Web App for Containers.\nIn the rest of the parameters for this task we specify the name of the container registry, the name of the image and the specific tag that we want to deploy. The tag is fetched from the build number of the associated build.\nFinally we set the following app settings:\nDOCKER_REGISTRY_SERVER_URL: The URL to the Docker registry\\ DOCKER_REGISTRY_SERVER_USERNAME: The login to the registry. For ACR, this is the name of the registry\\ DOCKER_REGISTRY_SERVER_PASSWORD: The password to the registry. For ACR, you can get this in the Access Keys blade in the Azure portal\\ That’s it. Running the release deployes the resource group (will take 1-2 minutes the first time) and then the container to the web app. Once done, you can browse the site and verify that it works as expected:\n","permalink":"https://blog.ehn.nu/2019/01/deploy-azure-web-app-for-containers-with-arm-and-azure-devops/","summary":"\u003cp\u003eUsing Docker containers  for building and running your applications has many advantages such as consistent builds, build-once run anywhere and easy standardized packaging and deployment format, just to name a few.\u003c/p\u003e\n\u003cp\u003eWhen it comes to running the containers you might look into container orchestrators such as Kubernetes or Docker Swarm. Sometimes though, these orchestrators can be overkill for your applications. If you are developing web applications that have only a few dependent runtime components, another options is to use \u003cstrong\u003eAzure Web App for Containers\u003c/strong\u003e, which is a mouthful for saying that you can use your beloved Azure Web Apps with all the functionality that comes with it (easy scaling, SSL support etc), but deploy your code in a container. Best of both worlds, perhaps?\u003c/p\u003e","title":"Deploy Azure Web App for Containers with ARM and Azure DevOps"},{"content":"Using Docker for compiling your code is great since that guarantees a consistent behaviour regardless of where you are building your code. No matter if it’s on the local dev machine or on a build server somewhere. It also reduces the need of installing any dependencies just to make the code compile. The only thing that you need to install is Docker!\nWhen you create a ASP.NET Core project in Visual Studio and add Docker support for it you will get a Docker file that looks something like this:\\\n\\\nFROM microsoft/dotnet:2.1-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 EXPOSE 443 FROM microsoft/dotnet:2.1-sdk AS build WORKDIR /src COPY [\u0026ldquo;WebApplication1/WebApplication1.csproj\u0026rdquo;, \u0026ldquo;WebApplication1/\u0026rdquo;] RUN dotnet restore \u0026ldquo;WebApplication1/WebApplication1.csproj\u0026rdquo; COPY . . WORKDIR \u0026ldquo;/src/WebApplication1\u0026rdquo; RUN dotnet build \u0026ldquo;WebApplication1.csproj\u0026rdquo; -c Release -o /app\nFROM build AS publish RUN dotnet publish \u0026ldquo;WebApplication1.csproj\u0026rdquo; -c Release -o /app\nFROM base AS final WORKDIR /app COPY \u0026ndash;from=publish /app . ENTRYPOINT [\u0026ldquo;dotnet\u0026rdquo;, \u0026ldquo;WebApplication1.dll\u0026rdquo;]\nThis is an example of a multistage Docker build. The first stage is based on the .NET Core SDK Docker image in which the code is restored, built and published. The second phase uses the smaller .NET Core runtime Docker image, to which the generated artifacts from the first phase is copied into.\nThe result is a smaller Docker image that will be pushed to a Docker registry and later on deployed to test- and production environments. Smaller images means faster download and startup times. Since it doesn’t contain as many SDKs etc, it also means that the surface area for security holes is much smaller.\nNow, this will compile just fine locally, and settting a build definition in Azure Pipelines is easy-peasy. Using the default Docker container build pipeline template, results in a build like this:\nBut, we want to run unit tests also, and then publish the test results back to Azure DevOps. How can we do this?\nRun Unit Tests in Docker First of all we need to build and run the tests inside the container, so we need to extend the Docker file. In this sample, I have added a XUnit test project called WebApplication1.UnitTests.\\\n\\\nFROM microsoft/dotnet:2.1-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 EXPOSE 443 FROM microsoft/dotnet:2.1-sdk AS build WORKDIR /src COPY [\u0026ldquo;WebApplication1/WebApplication1.csproj\u0026rdquo;, \u0026ldquo;WebApplication1/\u0026rdquo;] COPY [\u0026ldquo;WebApplication1.UnitTests/WebApplication1.UnitTests.csproj\u0026rdquo;, \u0026ldquo;WebApplication1.UnitTests/\u0026rdquo;] RUN dotnet restore \u0026ldquo;WebApplication1/WebApplication1.csproj\u0026rdquo; RUN dotnet restore \u0026ldquo;WebApplication1.UnitTests/WebApplication1.UnitTests.csproj\u0026rdquo; COPY . . RUN dotnet build \u0026ldquo;WebApplication1/WebApplication1.csproj\u0026rdquo; -c Release -o /app RUN dotnet build \u0026ldquo;WebApplication1.UnitTests/WebApplication1.UnitTests.csproj\u0026rdquo; -c Release -o /app\nRUN dotnet test \u0026ldquo;WebApplication1.UnitTests/WebApplication1.UnitTests.csproj\u0026rdquo; \u0026ndash;logger \u0026ldquo;trx;LogFileName=webapplication1.trx\u0026rdquo;\nFROM build AS publish RUN dotnet publish \u0026ldquo;WebApplication1.csproj\u0026rdquo; -c Release -o /app\nFROM base AS final WORKDIR /app COPY \u0026ndash;from=publish /app . ENTRYPOINT [\u0026ldquo;dotnet\u0026rdquo;, \u0026ldquo;WebApplication1.dll\u0026rdquo;]\nNow we are also restoring and compiling the test project, and then we run dotnet test to run the unit tests. To be able to publish the unit test results to Azure DevOps, we are using the –logger parameter which instructs dotnet to output a TRX file.\nNow comes the tricky part. When we run these tests as part of a build, the results end up inside the container. To publish the test results we need to access the results from outside the container. Docker volumes will not help us here, since we aren\u0026rsquo;t running the container, we are building it. Docker volumes are not supported when building a container.\nInstead we will add another task to our build definition that will use scripts to build the image, including running the unit tests, and the copiying the test results file from the container to a folder on the build server. We use the Docker Copy command to do this:\\\n\\\ndocker build -f ./WebApplication1/Dockerfile --target build -t webapplication1:$(build.buildid) . docker create -ti --name testcontainer webapplication1:$(build.buildid) docker cp testcontainer:/src/WebApplication1.UnitTests/TestResults/ $(Build.ArtifactStagingDirectory)/testresults docker rm -fv testcontainer Here we first build the image by using docker build. By using the –target parameter it will only execute the first phase of the build (there is no meaning to continue if the tests are failing). To access the file inside the container, we use docker create which is a way to create and configure a container before actually starting it. In this case we don’t need to start it, just use docker cp to extract the test result files to the host.\nNow we will have the TRX test results file in the artifact folder on the build server, which means we can just add a Publish Test Results task to our build definition:\nAnd voila, running the build now runs the unit tests and we can see the test results in the build summary as expected:\nComments Imported from the original WordPress site. Closed for new replies.\nSanti — 19 Jun 2019\nThis saved my day, thank you very much\nFarzad — 29 Dec 2019\nI\u0026rsquo;m not sure if I\u0026rsquo;m missing something, but from what I\u0026rsquo;ve been testing, I think this is what\u0026rsquo;s happening: if one or more tests fail, changes in the intermediate container running the tests won\u0026rsquo;t be committed to the image, so I think it\u0026rsquo;s only in the case of successful unit tests that the image will actually contain the results directory\nGT — 18 May 2020\nI noticed the same thing. When \u0026ldquo;dotnet test\u0026rdquo; fail, the entire docker build fails, and the testresults will not be created or copied properly\u0026hellip; unless I\u0026rsquo;ve failed to notice something quite elementary.\nJOHN — 22 Sep 2020\nif any of the test case not passed ; following will ignore docker build fail and continue build image\nRUN dotnet test \u0026ndash;logger trx; exit 0\nbut if wish to not to continue to next stage if test case fails , i believe then instead using \u0026ldquo;exit 0\u0026rdquo; , should write the \u0026ldquo;trx\u0026rdquo; file to volume.\nHope this help\nMichal — 21 Jun 2022\nI was struggling with publishing Test results to DevOps Services and solution was surprisingly easy, but also unintuitive - in the Publish Test results have to be \u0026lsquo;VSTest\u0026rsquo; even if you use XUnit tests.\nVikam — 26 Dec 2025\nWhere and how do we add this script for extracting test results?\n\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;\u0026ndash;\ndocker build -f ./WebApplication1/Dockerfile \u0026ndash;target build -t webapplication1:\u0026hellip;.\n","permalink":"https://blog.ehn.nu/2019/01/running-net-core-unit-tests-with-docker-and-azure-pipelines/","summary":"\u003cp\u003eUsing Docker for compiling your code is great since that guarantees a consistent behaviour regardless of where you are building your code. No matter if it’s on the local dev machine or on a build server somewhere. It also reduces the need of installing any dependencies just to make the code compile. The only thing that you need to install is Docker!\u003c/p\u003e\n\u003cp\u003eWhen you create a ASP.NET Core project in Visual Studio and add Docker support for it you will get a Docker file that looks something like this:\\\u003c/p\u003e","title":"Running .NET Core Unit Tests with Docker and Azure Pipelines"},{"content":"\nOn this page I\u0026rsquo;m listing my coming and past speaking engagements.\nIf you are interested in talks around DevOps on the Microsoft stack, Azure DevOps, container technologies (Docker, Kubernetes, Azure Kubernetes Services..), cloud architecture or something else interesting, contact me on Twitter (@jakobehn) or through this blog.\nComing Up 2020/04/23 NDC Porto Building resilient microservice applications with Dapr\nhttps://ndcporto.com/talk/building-resilient-microservice-applications-with-dapr/\n2020/05/5-6 Ignite the Tour Stockholm DevOps with Azure Kubernetes Service\nContainer Design Patterns\nhttps://www.microsoft.com/sv-se/ignite-the-tour/stockholm\n2020/05/28-29 DevSum Stockholm TBD\nPast 2020/02/27 Azure Community Live (online) Event-driven computing with Kubernetes\nhttps://www.youtube.com/watch?v=95HTszvGTZw\n2020/02/03 Swetugg 2020- Stockholm Keeping your builds green using Docker\nhttps://swetugg.se/sthlm-2020\n2019/12/13 CloudBrew 2019 Event-driven computing with Kubernetes\nhttps://www.cloudbrew.be/\n2019/11/14-15 Update Conference Prague 2019 Event-driven computing with Kubernetes\nhttps://www.updateconference.net/en/2019/speaker/jakob-ehn\n2019/11/06 All Day DevOps (online) Event-driven computing with Kubernetes\nhttps://www.alldaydevops.com/addo-speakers/jakob-ehn\n2019/10/23 Tech Days 2019- Stockholm DevOps with Azure Kubernetes Service\nhttps://www.tdswe.se/guest/jakob-ehn/\n2019/10/17 NDC Sydney 2019 Keeping your builds green using Docker\nhttps://ndcsydney.com/talk/keeping-your-builds-green-using-docker/\n2019/06/15 Global DevOps Bootcamp 2019 - Stockholm Hosting and coaching this worldwide event at the Solidify Stockholm office\nhttps://globaldevopsbootcamp.com/\n2019/05/23-24 DevSum 2019 A Lap around Azure DevOps\nhttps://www.devsum.se/speakers/jakob-ehn/\n2019-05-07 Swedish ALM/DevOps Meetup Keeping your builds green using Docker\nhttps://www.meetup.com/en-AU/swedish-ms-alm-devops/events/260111153/\n2019/04/24-25 Microsoft Ignite Tour - Stockholm Keeping your builds green using Docker\nContinuous Delivery with Azure Kubernetes Service\nhttps://www.microsoft.com/sv-se/ignite-the-tour/stockholm\n2019/02/07 Swetugg 2019 Real Programmers Commit to Master\nhttps://swetugg.se/swetugg-2019/speakers/jakob-ehn#real-programmers-commit-to-master\n2019/01/31 NDC London 2019 A Lap around Azure DevOps\nhttps://www.winops.org/london/\n2018/11/15 WinOps London 2018 Delivering Microservices with Visual Studio Team Services and Azure Kubernetes Services\nhttps://www.winops.org/london/agenda/deliveringmicroservices.php\n2018/11/08 IDG Code Night #13 Workshop: Secure code with the cloud (Swedish, with Peter Örneholm)\nhttps://techworld.event.idg.se/event/codenight/\n2018/10/24 Microsoft Tech Days Introduction to Azure Kubernetes\nhttps://tdswe.se/events/introduction-to-azure-kubernetes-services/\n2018/10/17 All Day DevOps Running Kubernetes on Microsoft Azure\nhttps://www.alldaydevops.com/addo-speakers/jakob-ehn\n2018/09/25 Stockholm Azure Meetup Introducing Azure DevOps\nhttps://www.meetup.com/Stockholm-Azure-Meetup/events/254383036/\n2018/09/06 SweNug Stockholm Micoservices with Visual Studio Team Services and Azure Kubernetes Services\nhttps://www.meetup.com/Swenug-Stockholm/events/252444168/\n2018/09/25 Swedish Microsoft ALM \u0026amp; DevOps Meetup VSTS and Azure Kubernetes Services\nhttps://www.meetup.com/swedish-ms-alm-devops/events/252113857/\n2018/06/19 Microsoft Insider Dev Tour Stockholm Creating DevOps Pipelines with Visual Studio Team Services\nhttps://insiderdevtour.com/stockholm\n2018/06/16 Global DevOps Bootcamp Co-hosted event in Stockholm and helped preparing labs\nhttps://globaldevopsbootcamp.com/\n2018/05/31 DevSum 18 Introduction to Kubernetes and Azure Kubernetes Services\nhttp://www.devsum.se\n2018/02/18 Swetugg .NET Conference Design your architecture for Continuous Deliverery\nhttps://www.youtube.com/watch?v=ofvGnCU0MjU\u0026amp;t=230s\n","permalink":"https://blog.ehn.nu/speaking/","summary":"\u003cp\u003e\u003ca href=\"conference.jpg\"\u003e\u003cimg loading=\"lazy\" src=\"/speaking/conference-1024x614.jpg\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eOn this page I\u0026rsquo;m listing my coming and past speaking engagements.\u003c/p\u003e\n\u003cp\u003eIf you are interested in talks around DevOps on the Microsoft stack, Azure DevOps, container technologies (Docker, Kubernetes, Azure Kubernetes Services..), cloud architecture or something else interesting, contact me on Twitter (@jakobehn) or through this blog.\u003c/p\u003e\n\u003ch2 id=\"coming-up\"\u003eComing Up\u003c/h2\u003e\n\u003ch5 id=\"20200423-ndc-porto\"\u003e2020/04/23  NDC Porto\u003c/h5\u003e\n\u003cp\u003eBuilding resilient microservice applications with Dapr\u003cbr\u003e\n\u003ca href=\"https://ndcporto.com/talk/building-resilient-microservice-applications-with-dapr/\"\u003ehttps://ndcporto.com/talk/building-resilient-microservice-applications-with-dapr/\u003c/a\u003e\u003c/p\u003e\n\u003ch5 id=\"2020055-6-ignite-the-tour-stockholm\"\u003e2020/05/5-6  Ignite the Tour Stockholm\u003c/h5\u003e\n\u003cp\u003eDevOps with Azure Kubernetes Service\u003cbr\u003e\nContainer Design Patterns\u003cbr\u003e\n\u003ca href=\"https://www.microsoft.com/sv-se/ignite-the-tour/stockholm\"\u003ehttps://www.microsoft.com/sv-se/ignite-the-tour/stockholm\u003c/a\u003e\u003c/p\u003e","title":"Speaking"},{"content":"Today Microsoft announced Azure DevOps, which is partly a rebranding of the existing Visual Studio Team Services but also has some exciting news.\nThe gist of the rebranding is that Azure DevOps is now a suite of service, where each service cna be acquired and used separately from the other ones. If you only want to use source control (and use some other CI/CD system) that’s fine.\nDo you have your code over at GitHub and want to use the CI/CD services in Azure DevOps? Works perfectly! By breaking the whole suite down into smaller services, it will make it easier for customers to find the best fit for their needs, without having to invest in the whole suite. Of course, you will still be able to easily get the whole suite when creating new accounts.\nThe new services as of today are (from the link above):\nAzure Pipelines Azure Pipelines CI/CD that works with any language, platform, and cloud. Connect to GitHub or any Git repository and deploy continuously.\nNB: This also includes a very generous offering targeted towards Open Source projects, where you get unlimited build minutes and 10 parallell build jobs\nAzure Boards Powerful work tracking with Kanban boards, backlogs, team dashboards, and custom reporting.\nAzure Artifacts Maven, npm, and NuGet package feeds from public and private sources.\nAzure Repos Unlimited cloud-hosted private Git repos for your project. Collaborative pull requests, advanced file management, and more.\nAzure Test Plans All in one planned and exploratory testing solution.\nComments Imported from the original WordPress site. Closed for new replies.\nLuna — 24 Sep 2018\nHar tyvärr blivit sjuk så blir hemma och vilar imorgon\n","permalink":"https://blog.ehn.nu/2018/09/meet-azure-devops-formerly-known-as-vsts/","summary":"\u003cp\u003eToday Microsoft announced \u003ca href=\"https://azure.microsoft.com/en-us/blog/introducing-azure-devops/\"\u003eAzure DevOps\u003c/a\u003e, which is partly a rebranding of the existing Visual Studio Team Services but also has some exciting news.\u003c/p\u003e\n\u003cp\u003eThe gist of the rebranding is that Azure DevOps is now a suite of service, where each service cna be acquired and used separately from the other ones. If you only want to use source control (and use some other CI/CD system) that’s fine.\u003c/p\u003e\n\u003cp\u003eDo you have your code over at GitHub and want to use the CI/CD services in Azure DevOps? Works perfectly! By breaking the whole suite down into smaller services, it will make it easier for customers to find the best fit for their needs, without having to invest in the whole suite. Of course, you will still be able to easily get the whole suite when creating new accounts.\u003c/p\u003e","title":"Meet Azure DevOps - formerly known as VSTS"},{"content":"In March, Mathias Olausson and I will run two fullday deep dive in continuous delivery and microservices on Azure.\nDuring the day you will learn about microservice architecture and how to build and deploy these using container technology and cloud services in Microsoft Azure.\nThe agenda looks like this:\nMicroservices architecture\nDesign principles- Breaking up the monolith\n- Implementing trunk based development practices with Visual Studio Team Services Feature flags- Pull requests- Branch/Build policies\n- Using container techonologies for packaging and delivering applications with zero downtime Docker for Windows- Kubernetes Azure Container registry Azure Container Services (AKS) Deployment pipelines with Visual Studio Team Services\nBuild automation- Release management Read more about the course here, and sign up:\nhttps://www.activesolution.se/event/a-deep-dive-into-continuous-delivery-and-microservices-on-azure/\nHope to see you either in Gothenburg or in Stockholm!\n","permalink":"https://blog.ehn.nu/2018/02/a-deep-dive-into-continuous-delivery-and-microservices-on-azure/","summary":"\u003cp\u003eIn March, \u003ca href=\"https://blogs.msmvps.com/molausson/\"\u003eMathias Olausson\u003c/a\u003e and I will run two fullday deep dive in continuous delivery and microservices on Azure.\u003c/p\u003e\n\u003cp\u003eDuring the day you will learn about microservice architecture and how to build and deploy these using container technology and cloud services in Microsoft Azure.\u003c/p\u003e\n\u003cp\u003eThe agenda looks like this:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eMicroservices architecture\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eDesign principles- Breaking up the monolith\u003cbr\u003e\n- Implementing trunk based development practices with Visual Studio Team Services\n\u003cul\u003e\n\u003cli\u003eFeature flags- Pull requests- Branch/Build policies\u003cbr\u003e\n- Using container techonologies for packaging and delivering applications with zero downtime\n\u003cul\u003e\n\u003cli\u003eDocker for Windows- Kubernetes\n\u003cul\u003e\n\u003cli\u003eAzure Container registry\u003c/li\u003e\n\u003cli\u003eAzure Container Services (AKS)\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eDeployment pipelines with Visual Studio Team Services\u003c/p\u003e","title":"A Deep Dive into continuous delivery and Microservices on Azure"},{"content":"If you are running your applications in Azure, and in particular on PaaS, you need to take a look ARM templates as a way to manage your environments. ARM templates let’s you define and deploy your entire environment using JSON files that you store together with the rest of your source code. The deployment of ARM templates are idempotent, meaning that you can run them many times and it will always produce the same result.\nIn this post, I will how you how to deploy ARM templates together with your application using Visual Studio Team Services. As you will see, I will not use the out of the box task for doing this, since it has some limitations. Instead we will use a PowerShell script to eexecute the deployment of an ARM template.\nThe overall steps are:\nDefining our ARM template for our environment.- Tokenize the ARM template parameters file- Create a PowerShell script that deploys the ARM template- Deploy everything from a VSTS release definition. Let’s get started with the ARM template.\nARM Template In this case, I will deploy an ARM template consisting of a Azure web app, a SQL Server + database and a Redis Cache. The web app and sql resources are easy to deploy, since we can supply all the input from my release definition. With the Redis cache however, Azure Resource Manager will create some information (such as the primarykey) as part of the deployment, which means we need to read this information from the output of the ARM template deployment.\nHere is the outline of our ARM template:\nNote the outputs section that is selected above, here we define what output we want to capture once the reource group has been deployed. In this case, I have defined three output variables:\nredis_host The fully qualified edish host name- redis_port The secure port that will be used to communicate with the cache- redis_primatykey\nThe access key that we will use to authenticate Since our web application will communicate with the Redis cache, we need to fetch this information from the ARM template deployment and store them in our web.cofig file. You will see later on how this can be done.\nLearn more about authoring ARM templates here: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates\nARM Template Tokenization When deploying our template in different environments (dev, test, prod…) we need to supply the information specific to those environment. In VSTS Release Management, the information is stored using environment variables. A common solution is to tokenize the files that is needed for deployment and then replace these tokens with the corresponding environment variable. To do this, we add a separate parameters file for the template that contains all the parameters but all the values are replaces with tokens:\n{ \u0026#34;$schema\u0026#34;: \u0026#34;http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#\u0026#34;, \u0026#34;contentVersion\u0026#34;: \u0026#34;1.0.0.0\u0026#34;, \u0026#34;parameters\u0026#34;: { \u0026#34;hostingPlanName\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__HOSTINGPLANNAME__\u0026#34; }, \u0026#34;administratorLogin\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__ADMINISTRATORLOGIN__\u0026#34; }, \u0026#34;administratorLoginPassword\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__ADMINISTRATORLOGINPASSWORD__\u0026#34; }, \u0026#34;databaseName\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__DATABASENAME__\u0026#34; }, \u0026#34;webSiteName\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__WEBAPPNAME__\u0026#34; }, \u0026#34;sqlServerName\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__SQLSERVERNAME__\u0026#34; }, \u0026#34;dictionaryName\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__DATABASENAMEDICTIONARY__\u0026#34; }, \u0026#34;extranetName\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__DATABASENAMEEXTRANET__\u0026#34; }, \u0026#34;instanceCacheName\u0026#34;: { \u0026#34;value\u0026#34;: \u0026#34;__INSTANCECACHENAME__\u0026#34; } }\n}\nWe wil then replace these tokens just before the template is deployed.\nPowerShell script There is an existing task for creating and updating ARM templates, called Azure Resource Group Deployment. This task let’s us point to an existing ARM template and the corresponding parameter file.\nHere is an example how how this task is typically used:\nThe problem with this task is that it has very limited support for output parameters. As you can see in the image above, you can map a variable to the output called Resource Group. Unfortunately there is an assumption that the resource group that you are creating contains virtual machines. If you execute this task with an ARM template containing for example an Azure Web App you will get the following error when trying to map the output to a variable:\n2017-01-23T09:09:49.8436157Z ##[error]The \u0026lsquo;Get-AzureVM\u0026rsquo; command was found in the module \u0026lsquo;Azure\u0026rsquo;, but the module could not be loaded. For more information, run \u0026lsquo;Import-Module Azure\u0026rsquo;.\nSo, to be able to read our output values we need to use PowerShell instead, which is arguably a better choice anyway since it allows you to run and test the deployment locally, saving you a lot of time.\nWhen we create an Azure Resource Group project in Visual Studio, we get a PowerShell script that we can use as a starting point.\nMost part of this script handles the case where we need to upload artifacts as part of the resource group deployment. In this case we don’t need this, we deploy all our artifacts from RM after the resource group has been deployed.\nHere is our PowerShell script that we will use to deploy the template:\n#Requires -Version 3.0\n#Requires -Module AzureRM.Resources\n#Requires -Module Azure.Storage\nParam( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] [Parameter(Mandatory=$true)] $ResourceGroupName, [string] [Parameter(Mandatory=$true)] $TemplateFile, [string] [Parameter(Mandatory=$true)] $TemplateParametersFile ) Import-Module Azure -ErrorAction SilentlyContinue\ntry {\n[Microsoft.Azure.Common.Authentication.AzureSession]::ClientFactory.AddUserAgent(\u0026ldquo;VSAzureTools-$UI$($host.name)\u0026quot;.replace(\u0026rdquo; \u0026ldquo;,\u0026rdquo;_\u0026quot;), \u0026ldquo;2.9\u0026rdquo;)\n} catch { }\nSet-StrictMode -Version 3\n$TemplateFile = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, $TemplateFile))\n$TemplateParametersFile = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, $TemplateParametersFile))\nCreate or update the resource group using the specified template file and template parameters file\\ New-AzureRmResourceGroup -Name $ResourceGroupName -Location $ResourceGroupLocation -Verbose -Force -ErrorAction Stop\n$output = (New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + \u0026#39;-\u0026#39; + ((Get-Date).ToUniversalTime()).ToString(\u0026#39;MMdd-HHmm\u0026#39;)) ` -ResourceGroupName $ResourceGroupName ` -TemplateFile $TemplateFile ` -TemplateParameterFile $TemplateParametersFile -Force -Verbose) Write-Output (\u0026quot;##vso[task.setvariable variable=REDISSERVER]\u0026quot; + $output.Outputs[\u0026lsquo;redis_host\u0026rsquo;].Value)\nWrite-Output (\u0026quot;##vso[task.setvariable variable=REDISPORT]\u0026quot; + $output.Outputs[\u0026lsquo;redis_port\u0026rsquo;].Value)\nWrite-Output (\u0026quot;##vso[task.setvariable variable=REDISPASSWORD;issecret=true]\u0026quot; + $output.Outputs[\u0026lsquo;redis_primarykey\u0026rsquo;].Value)\nThe special part of this script is the last three lines. Here, we read the output variables that we defined in the ARM template and then we use one of the VSTS logging commands to map these into variables that we can use in our release definition.\nThe syntax of the SetVariable logging command is ##vso[task.setvariable variable=NAME].\nNote: You can read more about these commands at https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md\nRelease Definition Finally we can put all of this together by creating a release definition that deploys the ARM template.\nNote: You will of course need to create a build definition that packages your scripts, ARM templates and deployment artifacts. I won’t show this here, but just reference the outputs from an existing build definition.\nHere is what the release definition will look like:\nLet’s walk through the steps:\nReplace tokens\nHere we replace the tokens in our parameters.json file that we definied earlier. There are several tasks in the marketplace for doing token replacement, I’m using the one from Guillaume Rouchon (https://github.com/qetza/vsts-replacetokens-task#readme)\\ **Deploy Azure environment**Run the PowerShell scipt using the Azure PowerShell task. This task handles the connection to Azure, so we don’t have to think about that.\nHere I reference the PowerShell script from the build output artifacts, and also I supply the necessary parameters to the PS script:\nScript Arguments\n*-ResourceGroupLocation \u0026ldquo;$(resourceGroupLocation)\u0026rdquo; -ResourceGroupName $(resourceGroupName) -TemplateFile \u0026ldquo;$(System.DefaultWorkingDirectory)/SampleApp.CI/environment/templates/sampleapp.json\u0026rdquo; -TemplateParametersFile \u0026ldquo;$(System.DefaultWorkingDirectory)/SampleApp.CI/environment/templates/sampleapp.parameters.json\u0026rdquo;\n* **Replace tokens **Now we need to update the tokens in our SetParameters file, that is used by web deploy. It is important that we run this task after running the deploy azure enviroment script, since we need the output variables from the resource group deployment. Remember, these variables are now available as environment variables, so they will be inserted in the same way as the variables that we have defined manually.\\ Deploy Web app + Deploy SQL Database\nThese steps just performs a simple deployment of an Azure Web App and a SQL dacpac deployment. That’s it, happy deployment! 🙂\nComments Imported from the original WordPress site. Closed for new replies.\nAkhil — 03 Jul 2017\nHi ,\nYour article was really helpful.\nI have a query as i\u0026rsquo;m trying to implement ALM via VSTS .I have a service fabric cluster and an App service [Angular 2 Applicaiton],so using IaaC i have to create them dynamically .Now my question is how can i pass the Service fabric applications path to my App Service dynamically\nFeodor — 12 Oct 2017\nNice work! Keep in mind that this can be extended even further by using Custom .NET activities in Azure, and thus the entire resource group can be scheduled for creation and deletion via ADF. Keep an eye on my blog posts, I have one coming soon exactly on this topic: https://www.red-gate.com/simple-talk/author/feodor-georgiev/\nJJose — 26 Apr 2021\nmay I know what this block does?\ntry {\n[Microsoft.Azure.Common.Authentication.AzureSession]::ClientFactory.AddUserAgent(“VSAzureTools-$UI$($host.name)”.replace(” “,”_”), “2.9”)\n} catch { }\n","permalink":"https://blog.ehn.nu/2017/02/deploying-arm-templates-using-visual-studio-team-services/","summary":"\u003cp\u003eIf you are running your applications in Azure, and in particular on PaaS, you need to take a look ARM templates as a way to manage your environments. ARM templates let’s you define and deploy your entire environment using JSON files that you store together with the rest of your source code. The deployment of ARM templates are idempotent, meaning that you can run them many times and it will always produce the same result.\u003c/p\u003e","title":"Deploying ARM Templates using Visual Studio Team Services"},{"content":"We have decided that it is time to create a meetup group for people that are interested in the Microsoft ALM and DevOps story!\nTogether with Mathias Olausson and a few other people we have created a new Meetup group and announced the first meeting.\nOur plan is to continue meeting every month or so to learn about and dicuss new concept and ideas in the area of ALRM and DevOps on the Microsoft stack. This is a wide area, which spans all roles in the development process, so there will be something for everyone.\nFirst meetup: Microsoft Team Services Agile Transformation Story + VS ALM Update The first meeting is set to October 25th, where we will have Jose Rady Allende, a Program Manager on the Visual Studio Team Services tean, join us online to talk about the Microsoft Team Service Agile Transformation story. We’ll also going to have a few lightning talks where we will talk about recent new additions to the TFS/VSTS platform\nMeeting link: http://www.meetup.com/swedish-ms-alm-devops/events/234449734/ There are already around 25 people that have signed up for it, so sign up before it gets full!\nHeop to see you there!\n","permalink":"https://blog.ehn.nu/2016/10/new-swedish-meetup-group-for-microsoft-alm-and-devops/","summary":"\u003cp\u003eWe have decided that it is time to create a meetup group for people that are interested in the Microsoft ALM and DevOps story!\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://www.meetup.com/swedish-ms-alm-devops/\" title=\"Sweden Microsoft ALM and DevOps Meetup\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2016/10/new-swedish-meetup-group-for-microsoft-alm-and-devops/image-1.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eTogether with \u003ca href=\"http://blogs.msmvps.com/molausson\"\u003eMathias Olausson\u003c/a\u003e and a few other people we have created a new Meetup group and announced the first meeting.\u003c/p\u003e\n\u003cp\u003eOur plan is to continue meeting every month or so to learn about and dicuss new concept and ideas in the area of ALRM and DevOps on the Microsoft stack. This is a wide area, which spans all roles in the development process, \u003cbr\u003e\nso there will be something for everyone.\u003c/p\u003e","title":"New Swedish Meetup Group for Microsoft ALM and DevOps"},{"content":"This post does not really cover something new, but since I find myself explain this to people now and then, I thought that I’d write a quick post on the subject.\nSo, we want to create a web deploy package as part of our automated build, and then take this package and deploy it to multiple environments, where each environment can have different configuration settings, using VSTS Release Management. Since we only want to build our package once, we have to apply the environment specific settings at deployment time, which means we will use Web Deploy parameters.\nHere are the overall steps needed:\nCreate a parameters.xml file in your web project- - Create a publish profile for the web deploy package- - Set up a VSTS build creates the web deploy package, and uploads the package to the server- - Create a Release definition in VSTS that consumes the web deploy package- - In each RM environment, replaces the tokens in the SetParameters file Let’s run through these steps in detail:\nCreate a parameters.xml file As you will see later on, a publish profile contains configurable settings for the web site name and any connection strings,that will end up in the *.SetParameters.xml file that is used when at deployment time. But in order for other configuration settings, like appSettings, to end up in this file, you need to define these settings. This is done by creating a file called parameters.xml in the root of your web application.\nTip: A fellow MVP, Richard Fennell, has created a nifty Visual Studio extension that simplifies the process of creating the parameters.xml file. It will look at your web.config file and the create a parameters.xml file with all the settings that it finds.\nIn this case, I have three application settings in the web.config file, so I end up with this parameters.xml file. Note that I have set the defaultvalue attribute for all parameters to TOKEN. These are the configuration values that will end up in the MyApp.SetParameters.xml file, together with the web deployment package. We will replaced these values at deployment time, by a task in our release definition.\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ \u0026lt;parameters\u0026gt; \u0026lt;parameter name=\u0026#34;IsDevelopment\u0026#34; description=\u0026#34;Description for IsDevelopment\u0026#34; defaultvalue=\u0026#34;__ISDEVELOPMENT__\u0026#34; tags=\u0026#34;\u0026#34;\u0026gt; \u0026lt;parameterentry kind=\u0026#34;XmlFile\u0026#34; scope=\u0026#34;\\\\web.config$\u0026#34; match=\u0026#34;/configuration/applicationSettings/MyApp.Properties.Settings/setting[@name=\u0026#39;IsDevelopment\u0026#39;]/value/text()\u0026#34; /\u0026gt; \u0026lt;/parameter\u0026gt; \u0026lt;parameter name=\u0026#34;WebApiBaseUrl\u0026#34; description=\u0026#34;Description for WebApiBaseUrl\u0026#34; defaultvalue=\u0026#34;__WEBAPIBASEURL__\u0026#34; tags=\u0026#34;\u0026#34;\u0026gt; \u0026lt;parameterentry kind=\u0026#34;XmlFile\u0026#34; scope=\u0026#34;\\\\web.config$\u0026#34; match=\u0026#34;/configuration/applicationSettings/MyApp.Properties.Settings/setting[@name=\u0026#39;WebApiBaseUrl\u0026#39;]/value/text()\u0026#34; /\u0026gt; \u0026lt;/parameter\u0026gt; \u0026lt;parameter name=\u0026#34;SearchFilterDelta\u0026#34; description=\u0026#34;Description for SearchFilterDelta\u0026#34; defaultvalue=\u0026#34;__SEARCHFILTERDELTA__\u0026#34; tags=\u0026#34;\u0026#34;\u0026gt; \u0026lt;parameterentry kind=\u0026#34;XmlFile\u0026#34; scope=\u0026#34;\\\\web.config$\u0026#34; match=\u0026#34;/configuration/applicationSettings/MyApp.Properties.Settings/setting[@name=\u0026#39;SearchFilterDelta\u0026#39;]/value/text()\u0026#34; /\u0026gt; \u0026lt;/parameter\u0026gt; \u0026lt;/parameters\u0026gt; Creating a Publish Profile Now, let’s create a publish profile that define how the web deployment package should be created. Right-click on the web application project and then select Publish. Then select the Custom option:\nSince the publish profile will be used to create a web deployment package, I like to call it CreatePackage (but you are of course free to call it whatever you want)\nOn the Connection tab, select Web Deploy Package as the publish method, then give the generated package a name (including .zip).\nAs the Web Site name, we enter a tokenized value WEBSITE. This token will also end up in the MyApp.SetParameters.xml file.\nSave the publish profile and commit and push your changes. Now it’s time to create a build definition.\nCreate a Build Definition that generates a web deploy package I won’t go through all the details of creating a build definition in VSTS, but just focus on the relevant parts for this blog post.\nTo generate a web deploy package, we need to pass some magic MSBuild parameters as part of the Visual Studio build task. Since we have a publish profile that contains our settings, we need to refer to this file. We also want to specify where the resulting files should be placed.\nEnter the following string in the MSBuild Arguments field:\n/p:DeployOnBuild=true /p:PublishProfile=CreatePackage /p:PackageLocation=$(build.stagingDirectory)\nDeployOnBuild=true is required to trigger the web deployment publishing process, and the we use the PackageLocation property to specify that the output should be places in the staging directory of the build. This will make it easy to upload the artifacts at the end of the build, like so:\nThis will generate an artifact called drop in the build that contains all files needed to deploy this application using MSDeploy:\nAs you can see, we have all the generated web deploy files here. We will use three of them:\nMyApp.zip – The web deploy package\nMyApp.SetParameters.xml – The parameterization file that contains our tokenized parameters\nMyApp.Deploy.cmd – A command file that simplifies running MSDeploy with the correct parameters\nCreating a Release Definition Finally, we will create a release definition that deploys this web deploy package to two different environments, let’s call them Test and Prod. In each environment we need to apply the correct configuration values. To do this, we have to replace the token variables in our MyApp.SetParameters.xml file.\nThere is no out of the box task to do this currently, but there are already several of them in the Visual Studio Marketplace. Here, I will use the Replace Tokens task from Guillaume Rochon, available at https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens. Install it to your Visual Studio Team Services account, and then the task will be available in the build/release task catalog, in the Utility category:\nEach environment in the release definition will just contain two tasks, the first one for the token replacement and the other one for deploying the web deploy package. To do this, we just run the MyApp.deploy.cmd file that was generated by the build. Since the parameters have already been set with the correct values, we can just run this without any extra arguments.\nAlso, we must specify the values for each variable in the environment. Right click on the environment and the add these variables:\nTip: Create the Test environment first with all variables and tasks. Once it’s done, use the Clone environment feature to create a Prod environment, and then just replace the configuration values\nThat’s it, now you can run the release and it will deploy your web application with the correct configuration to each environment.\nComments Imported from the original WordPress site. Closed for new replies.\nDeepan — 26 May 2016\nHi, When you run the tokenizer task second time. It will not find the \u0026ldquo;tokens\u0026rdquo;, lets say you first have one package deployed to development, then the setparameters.xml tokens already replaced. So the production release just after will deploy the same parameters again to PROD ?\nJakob Ehn — 09 May 2017\nDeepan, the production release is implemented in a different environment, so the artifacts (including the SetParameter.xml file) will be downloaded again with the new values.\nIf you however deplloy the same package multiple times in the same RM environment, you will have this problem\n","permalink":"https://blog.ehn.nu/2016/03/using-web-deploy-in-visual-studio-team-services-release-management/","summary":"\u003cp\u003eThis post does not really cover something new, but since I find myself explain this to people now and then, I thought that I’d write a quick post on the subject.\u003c/p\u003e\n\u003cp\u003eSo, we want to create a web deploy package as part of our automated build, and then take this package and deploy it to multiple environments, where each environment can have different configuration settings, using VSTS Release Management. Since we only want to build our package once, we have to apply the environment specific settings at deployment time, which means we will use \u003ca href=\"https://msdn.microsoft.com/en-us/library/ff398068(v=vs.110).aspx\"\u003e\u003cem\u003e\u003cstrong\u003eWeb Deploy parameters\u003c/strong\u003e\u003c/em\u003e\u003c/a\u003e.\u003c/p\u003e","title":"Using Web Deploy in Visual Studio Team Services Release Management"},{"content":"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. Active Solution, where I work, was a gold partner for this event and in addition to me my colleagues Alan Smith and Peter Örneholm 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.\nThis year I had the fortune to be selected again to speak at DevSum16, and this time I will talk about the different options around integration and extensibility of the Visual Studio ALM platform. This means that I will talk about things like Service Hooks, OAuth, REST API and UI extensibility among other things.\nHere is the session description (http://www.devsum.se/speaker/jakob-ehn/), hope to see you there!\nDon’t be locked in – Integrate and Extend the Visual Studio ALM Platform The days when you used one tool chain for all your development are long gone. Developing modern applications today often requires a variety of tools, both 3rd party tools and services\nbut also homegrown systems are often used as part of the process. In the new era of Microsoft the term “Open ALM” is key, focusing on trying to build best in breed tools for software development companies, but at the same time make sure that it is open and extensible.\nIn this session we will look at the different options for integrating and extending Visual Studio TFS and Team Services. We will look at:\nUsing Service Hooks to automate workflows with other services such as Trello, GitHub and Jenkins. - Utilizing the REST API to automate processes in TFS - Extending the Web UI itself with custom extensions, from simple context menus to full-fledged custom pages and hubs. We will also look at how we can publish these extensions\nto the new Visual Studio Marketplace ","permalink":"https://blog.ehn.nu/2016/03/talking-visual-studio-alm-extensibility-at-devsum16/","summary":"\u003cp\u003eLast 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. \u003ca href=\"http://www.activesolution.se\"\u003eActive Solution\u003c/a\u003e, where I work, was a gold partner for this event and in addition to me my colleagues \u003ca href=\"http://geekswithblogs.net/asmith/Default.aspx\"\u003eAlan Smith\u003c/a\u003e and \u003ca href=\"http://peter.orneholm.com/\"\u003ePeter Örneholm\u003c/a\u003e 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.\u003c/p\u003e","title":"Talking Visual Studio ALM Extensibility at DevSum16"},{"content":"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 http://blog.ehn.nu/2015/06/building-github-repositories-in-tfs-build-vnext/.\nPublisinh a GitHubRelease from VSTS 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.\nTo make this easy, I have developed a custom build task lets you publish your build artifacts into a release at GitHub.\nThe task is available over at the new Visual Studio Marketplace, you can find the extension here: https://marketplace.visualstudio.com/items?itemName=jakobehn.jakobehn-vsts-github-tasks\nTo use it, just press the Install button and select the VSTS account where you want to install it. After this, the Publish GitHub Release build task will be available in your build task catalog, in the Deploy category.\nFrom Team Foundation Server 2015 Update 2, it is possible to install the extensions from the VS Marketplace on premise. To do so, use the Download button and follow the instructions.\nAfter adding the build task to a build definition, you need to configure a few parameters:\nThese parameters are:\n**Application Name**You can use any name here, this is what is sent to the GitHub API in the request header. **Token**Your GitHub Personal Access Token (PAT). For more information about GitHub tokens, please see https://help.github.com/articles/creating-an-access-token-for-command-line-use/\n**Repository Name**The name of the repository where the release should be created Owner The GitHub account of the owner of the release Tag Name A unique tag for the release. Often it makes sense to include the build number here\\ Release Name\nThe name of the release. Also, including the build number here can make sense\\ Draft\nEnable this to create a draft release\\ Prerelease\nEnable this to create a prerelease\nAssets to upload\nSpecified which files that should be included in the GitHub release Hope that you will find this extension useful, if you find bugs or have feature suggestions, please report them on the GitHub site at https://github.com/jakobehn/VSTSGitHubTasks\nComments Imported from the original WordPress site. Closed for new replies.\nsatish venkatakrishnan — 13 Jul 2016\nVery useful post . I am setting up a build for my open source project . Will be using this for the release .\nThanks .\nThere is a small typo in the post - It should be Publishing (In header)\nBruce Haley — 30 Aug 2018\nHints on filling out the build task form:\nApplication Name: You can use any name as long as it contains no spaces.\nRepository Name and Owner: Those values must match the values embedded in your target GitHub URL:\nhttps://github.com/Owner/RepositoryName\n","permalink":"https://blog.ehn.nu/2016/03/publish-a-github-release-from-visual-studio-team-services/","summary":"\u003cp\u003eThe 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 \u003ca href=\"/2015/06/building-github-repositories-in-tfs-build-vnext/\" title=\"http://blog.ehn.nu/2015/06/building-github-repositories-in-tfs-build-vnext/\"\u003ehttp://blog.ehn.nu/2015/06/building-github-repositories-in-tfs-build-vnext/\u003c/a\u003e.\u003c/p\u003e\n\u003ch4 id=\"publisinh-a-githubrelease-from-vsts\"\u003ePublisinh a GitHubRelease from VSTS\u003c/h4\u003e\n\u003cp\u003eThis 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.\u003c/p\u003e","title":"Publish a GitHub Release from Visual Studio Team Services"},{"content":"Today Brian Harry announced that the first release of TFS 2015 Update 2 is available. It is an RC with a go-live license, which means that Microsoft will support you if you install it in production, and it will be a direct supported upgrade to RTM once it is released.\nRead the full release notes for Update 2 RC1 here: https://www.visualstudio.com/en-us/news/tfs2015-update2-vs\nOne huge thing with the release is that Update 2 includes the new Release Management vNext feature that has up until now only been available in the service (although you can use that for on premise TFS and deployments). But now you don’t have to rely on VSTS for hosting the service, it is now part of TFS 2015 Update 2!\nAnd of course, if you want to learn (a lot) more about hwo to implement continuous delivery using TFS 2015, with the new build and release management features, grab a copy of our latest book on the topic, Continuous Delivery with Visual Studio ALM 2015:\n","permalink":"https://blog.ehn.nu/2016/02/tfs-2015-update-2-rc1-available-with-vs-release-management-vnext/","summary":"\u003cp\u003eToday \u003ca href=\"https://blogs.msdn.microsoft.com/bharry/2016/02/10/team-foundation-server-2015-update-2-rc-1-is-available/\"\u003eBrian Harry announced that the first release of TFS 2015 Update 2\u003c/a\u003e is available. It is an RC with a go-live license, which means that Microsoft will support you if you install it in production, and it will be a direct supported upgrade to RTM once it is released.\u003c/p\u003e\n\u003cp\u003eRead the full release notes for Update 2 RC1 here: \u003ca href=\"https://www.visualstudio.com/en-us/news/tfs2015-update2-vs\" title=\"https://www.visualstudio.com/en-us/news/tfs2015-update2-vs\"\u003ehttps://www.visualstudio.com/en-us/news/tfs2015-update2-vs\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eOne huge thing with the release is that Update 2 includes the \u003ca href=\"/2015/12/microsoft-announces-next-generation-of-visual-studio-release-management/\"\u003enew Release Management vNext\u003c/a\u003e feature that has up until now only been available in the service (although \u003ca href=\"/2016/01/deploy-on-premise-builds-with-visual-studio-release-management-vnext/\"\u003eyou can use that for on premise TFS and deployments\u003c/a\u003e). But now you don’t have to rely on VSTS for hosting the service, it is now part of TFS 2015 Update 2!\u003c/p\u003e","title":"TFS 2015 Update 2 RC1 Available – With VS Release Management vNext"},{"content":"Microsoft\u0026rsquo;s new version of Visual Studio Release Management is currently in public preview in VSTS. It is currently targeted for the TFS 2015 Update 2 version that should be shipped later this spring.\nHowever, even if you are not all in on Visual Studio Team Services, you can still use this service! Since the build/release agents that are used can run on premise without any necessary firewall ports being opened inbound, you have full access to any internal TFS servers and application servers that you want to deploy to.\nThe following image illustrates the different components involved here.\nAs you can see everything is running on premise, except Visual Studio Team Services of course. Since the release agent is also running on premise, it can connect to the on premise TFS and download the build artifacts, and it can access the on premise application servers and deploy the artifacts.\nLets’s walk through how you can use Visual Studio Release Management today to deploy builds from your on premise TFS build server to an on premise web server.\nCreating the Release Definition I’m not going to walk through how to create a build definition in TFS, there are plenty of documentation on that. Let’s just look at the artifacts of the build that we will deploy:\n\\ Nothing special here, this is the standard output from a build that runs msdeploy to create web deploy packages.\\ Now, to be able to consume the build artifacts from a release definition, we need to setup a service endpoint for the TFS server. In the new build and release management system, service endpoints are a fundamental concept. They encapsulate the information, including credentials, that is needed to integrate with an external system. Example of service endpoints include Azure subscriptions, Jenkins build servers and Chef servers. In addition we can create Generic service endpoints, which contains a server URL and a user name and a password. This is what we will use here. \\ Service endpoints also have there own security groups, which means that we can for example make sure that only certain people can use a service endpoint that points to the production Azure subscription\nService points are scoped to the team project level, and are available on a separate tab on the admin page. In this case, we will create a Team Build endpoint, where we supply the URL of the TFS server and the necessary credentials for it:\n\\ With the service endpoint done, we can move on to create a release definition. In this example, I will define two environments, Dev and Prod that will just point to two different web sites on the same server.\nAs you can see, I only have two tasks in each environment. The first task is a custom task that replaces any tokens found in the files that matches the supplied pattern.. This lets me apply environment specific values during the build. In this case, I will update the *.SetParameter.xml file that is used together with web deploy.\nAlso, I use the configuration functionality to supply the machine name of the web server and the name of the web site that I will deploy this to. As you can see below, I will deploy both dev and production to the same server, but to different web sites. Not entirely realistic, but you should get the idea here. You can see that I use the variable $(webSite) in the task above, where I run the generated web deploy command file.\n\\ Now, the part that is different here compared to a standard release definition is the linking of artifacts. Here we will select “Team Build (external)”, which in this context mean any TFS server that is defined as a service endpoint. In the Service dropdown we select the service endpoint that we created earlier (TFS).We also need to supply the name of the team project and the name of the build definition, as shown below.\n\\ NOTE: When linking to an external build like this, we do it by name. This means that if you change the name of the build definition or the team project, you will have to change this artifact definition.- Now we can save the release definition and start a release. A big difference compared to when you have linked to a VSTS build is that RM won’t locate the existing builds for you, so you have to supply the build number yourself of the build that you want to release.- \\ When the release has finished we can see that the selected build version (1.0.0.6) has been deployed to both environments:\\ Summary As you can see, there is nothing that stops you from start using the new version of Visual Studio Release Management, even if you have everything else on premise.\nComments Imported from the original WordPress site. Closed for new replies.\nVenkat — 27 Apr 2016\nHi This is really help full but, i have couple of doubts.\\\non point #4 we are linking the tfs server. Here are we linking to on-premise tfs server by giving the onprem tfs url? If we are linking so, how will it be communicate with on-perm tfs server when it is not exposed to internet? and how it can it drive the release pipeline when agents are in onprem which is inside the organization network?\nCan you please explain more about this? ","permalink":"https://blog.ehn.nu/2016/01/deploy-on-premise-builds-with-visual-studio-release-management-vnext/","summary":"\u003cp\u003eMicrosoft\u0026rsquo;s \u003ca href=\"/2015/12/microsoft-announces-next-generation-of-visual-studio-release-management/\"\u003enew version of Visual Studio Release Management\u003c/a\u003e is currently in public preview in VSTS. It is currently targeted for the TFS 2015 Update 2 version that should be shipped later this spring.\u003c/p\u003e\n\u003cp\u003eHowever, even if you are not all in on Visual Studio Team Services, you can still use this service! Since the build/release agents that are used can run on premise without any necessary firewall ports being opened inbound, you have full access to any internal TFS servers and application servers that you want to deploy to.\u003c/p\u003e","title":"Deploy On Premise Builds with Visual Studio Release Management vNext"},{"content":"I have blogged before about how to deploy an Azure Web App using the new build system in TFS 2015/Visual Studio Team Services. In addition to configure an Azure service endpoint, it is really only a matter of using the built-in Azure Web App Deployment task.\nHowever, in many cases I have decided not to use this task myself since it has been lacking a key feature: Applying deployment parameters using the SetParameter.xml file.\nAs I have mentioned a gazillion times, building your binaries once and only once is a key principle when implementing continuous delivery. If you are using web deploy for deploying web applications (and you should), you must then use Web Deploy parameters to apply the correct configuration values at deployment time.\nUnder the hood the Azure Web App Deployment task uses the Publish-AzureWebsiteProject cmdlet that uses web deploy to publish a web deploy package to Microsoft Azure. Up until recently, this cmdlet did not support web deploy parameters, the only thing that you could substitute was the connecting string, like so:\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ Publish-AzureWebsiteProject -Name site1 -Package package.zip -ConnectionString @{ DefaultConnection = \u0026#34;my connection string\u0026#34; } However, it is actually possible to specify the path to the SetParameter.xml file that is generated together with the web deploy package. To do this, you can use the –SetParametersFile parameter, like so:\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ Publish-AzureWebsiteProject -Name Site1 -Package package.zip -SetParametersFile package.SetParameters.xml When using the Azure Web App Deployment task, there is no separate parameter for this but you can use the Additional Arguments parameter to pass this information in:\nNote: In this case, I am using the Azure Web App Deployment task as part of a release definition in Visual Studio Release Management, but you can also use it in a regular build definition.\nThis will apply the parameter values defined in the QBox.Web.SetParameters.xml file when deploying the package to the Azure Web App.\nIf you are interested, here is the pull request that implemented support for SetParameters files: https://github.com/Azure/azure-powershell/pull/316\nComments Imported from the original WordPress site. Closed for new replies.\nET — 29 Jan 2016\nThanks for this post Jakob I was struggling to find how to do this.\nDavid — 12 Apr 2016\nJakob,\nIs this still valid? I couldn\u0026rsquo;t get it to work though I\u0026rsquo;m sure it is on my end.\nBalaji — 28 Apr 2016\niam getting error when i setup -SetParameters in to Azure Web App deployment.\nThe error is below,\na positional parameter cannot be found that accepts argument \u0026lsquo;Registration\u0026rsquo;.\n","permalink":"https://blog.ehn.nu/2016/01/deploy-azure-web-apps-with-parameterization/","summary":"\u003cp\u003eI have \u003ca href=\"http://geekswithblogs.net/jakob/archive/2015/04/29/deploying-an-azure-web-site-using-tfs-build-vnext.aspx\"\u003eblogged before about how to deploy an Azure Web App using the new build system\u003c/a\u003e in TFS 2015/Visual Studio Team Services. In addition to configure an Azure service endpoint, it is really only a matter of using the built-in \u003ca href=\"https://github.com/Microsoft/vso-agent-tasks/blob/master/Tasks/AzureWebPowerShellDeployment/task.json\"\u003eAzure Web App Deployment\u003c/a\u003e task.\u003c/p\u003e\n\u003cp\u003eHowever, in many cases I have decided not to use this task myself since it has been lacking a key feature: Applying deployment parameters using the SetParameter.xml file.\u003c/p\u003e","title":"Deploy Azure Web Apps with Parameterization"},{"content":"Since a couple of months back, Microsoft new Release Management service is available in public preview in Visual Studio Team Services. According to the current time plan, it will be released for on-premise TFS in the next update (Update 2).\nUsing a tool like release management allows you to implement a deployment pipeline by grabbing the binaries and any other artifacts from your release build, and then deploy them across different environments with the proper configuration and approval workflow. Building your binaries once and only once is a fundamental principal of implementing continuous delivery, too much can go wrong if you build your application every time you deploy it into a new environment.\nHowever, sometimes you might not have the opportunity to setup a release management tool like VSTS or Octopus Deploy, but you still want to be able to build your binaries once and deploy them. Well, you can still implement your deployment using TFS Build, but instead of building your source code during every build we download the artifacts from another build that already has completed.\nLet’s look at how we can implement this using PowerShell and the REST API in TFS/VSTS.In this sample we will execute this script as part of a TFS build, in order to create a “poor mans” deployment pipeline. If you want to use the script outside of TFS Build, you need to replace some environment variables that are used in the script below.\nDownloading Build Artifacts using PowerShell and the REST API First of all, to learn about the REST API and other ways to integrate and extend Visual Studio, TFS and Visual Studio Team Services, take a look at https://www.visualstudio.com/integrate. This is a great landing page that aggregate a lot of information about extensibility.\nHere is a PowerShell script that implements this functionality, as well as a few other things that is handy if you implement a deployment pipeline from a build definition.\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ [CmdletBinding()] param( [Parameter(Mandatory=$True)] [string]$buildDefinitionName, [Parameter()] [string]$artifactDestinationFolder = $Env:BUILD_STAGINGDIRECTORY, [Parameter()] [switch]$appendBuildNumberVersion = $false ) Write-Verbose -Verbose (\u0026#39;buildDefinitionName: \u0026#39; + $buildDefinitionName) Write-Verbose -Verbose (\u0026#39;artifactDestinationFolder: \u0026#39; + $artifactDestinationFolder) Write-Verbose -Verbose (\u0026#39;appendBuildNumberVersion: \u0026#39; + $appendBuildNumberVersion) $tfsUrl = $Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI + $Env:SYSTEM_TEAMPROJECT $buildDefinitions = Invoke-RestMethod -Uri ($tfsURL + \u0026#39;/_apis/build/definitions?api-version=2.0\u0026amp;name=\u0026#39; + $buildDefinitionName) -Method GET -UseDefaultCredentials $buildDefinitionId = ($buildDefinitions.value).id; $tfsGetLatestCompletedBuildUrl = $tfsUrl + \u0026#39;/_apis/build/builds?definitions=\u0026#39; + $buildDefinitionId + \u0026#39;\u0026amp;statusFilter=completed\u0026amp;resultFilter=succeeded\u0026amp;$top=1\u0026amp;api-version=2.0\u0026#39; $builds = Invoke-RestMethod -Uri $tfsGetLatestCompletedBuildUrl -Method GET -UseDefaultCredentials $buildId = ($builds.value).id; if( $appendBuildNumberVersion) { $buildNumber = ($builds.value).buildNumber $versionRegex = \u0026#34;d+.d+.d+.d+\u0026#34; # Get and validate the version data $versionData = [regex]::matches($buildNumber,$versionRegex) switch($versionData.Count) { 0 { Write-Error \u0026#34;Could not find version number data in $buildNumber.\u0026#34; exit 1 } 1 {} default { Write-Warning \u0026#34;Found more than instance of version data in buildNumber.\u0026#34; Write-Warning \u0026#34;Will assume first instance is version.\u0026#34; } } $buildVersionNumber = $versionData[0] $newBuildNumber = $Env:BUILD_BUILDNUMBER + $buildVersionNumber Write-Verbose -Verbose \u0026#34;Version: $newBuildNumber\u0026#34; Write-Verbose -Verbose \u0026#34;##vso[build.updatebuildnumber]$newBuildNumber\u0026#34; } $dropArchiveDestination = Join-path $artifactDestinationFolder \u0026#34;drop.zip\u0026#34; #build URI for buildNr $buildArtifactsURI = $tfsURL + \u0026#39;/_apis/build/builds/\u0026#39; + $buildId + \u0026#39;/artifacts?api-version=2.0\u0026#39; #get artifact downloadPath $artifactURI = (Invoke-RestMethod -Uri $buildArtifactsURI -Method GET -UseDefaultCredentials).Value.Resource.downloadUrl #download ZIP Invoke-WebRequest -uri $artifactURI -OutFile $dropArchiveDestination -UseDefaultCredentials #unzip Add-Type -assembly \u0026#39;system.io.compression.filesystem\u0026#39; [io.compression.zipfile]::ExtractToDirectory($dropArchiveDestination, $artifactDestinationFolder) Write-Verbose -Verbose (\u0026#39;Build artifacts extracted into \u0026#39; + $Env:BUILD_STAGINGDIRECTORY) This script accepts three parameters:\n**buildDefinitionName**This is a mandatory parameter where you can specify the name of the build definition from which you want to download the artifacts from. This script assumes that the build definition is located in the same team project as the build definition in which this script is running. If this is not the case, you need to add a parameter for the team project.\n**artifactsDestinationFolder**This is an optional parameter that let’s you specify the folder where the artifacts should be downloaded to. If you leave it empty, it will be downloaded to the staging directory of the build (BUILD_STAGINGDIRECTORY)\n**appendBuildNumberVersion**A switch that indicates if you want to append the version number of the linked build to the build number of the running build. Since you are actually releasing the build version that you are downloading artifacts from, it often makes sense to use this version number for the deployment build. The script will extract a 4 digit version (x.x.x.x) from the build number and then append it to the build number of the running build.\nAs an example, if the latest release build has the build number MyApplication-1.2.3.4, the build will extract 1.2.3.4 and append this to the end of the build number of the running build.\nRunning the script in TFS Build Running a PowerShell script in TFS Build is really easy, but I’ll include it here anyway. Typically you will run this script in the beginning of a build in order to get the build artifacts, and then add the tasks related to deploying the artifacts in whatever way that fits.\nAdd the script to source control and then add a PowerShell task to the build definition and select the script from the repository. Then specify the parameters of the tasks in the argument field\nHere is a sample argument:\n-buildDefinitionName MyApplication.Release –appendBuildNumberVersion\nWhere MyApplication.Release is the name of the build definition that have produced the build artifacts that we want to release.\nRunning this script as part of the build will not download the artifacts from the latest successful build of the linked build definition and place them in the staging directory. In addition it will append the version number of the linked build (x.x.x.x) to the end of the running build.\nNB: You need to consider where to place this script. Often you’ll want to put this script together with the application that you are deploying, so that they can change and version together.\nHope you will find this script useful, le me know if you have any issues with it!\nHappy building!\nPS: If you want to learn more about implementing Continuous Delivery using Visual Studio Team Services and TFS, grab a copy of my and Mathias Olausson’s latest book “Continuous Delivery with Visual Studio ALM 2015”\nComments Imported from the original WordPress site. Closed for new replies.\nYassine — 06 Apr 2016\nThank you for this script, I have a question, how do this script do the authentication to have the authorization to download the artifact ? I can just see the http request here against the Rest api.\n","permalink":"https://blog.ehn.nu/2016/01/downloading-build-artifacts-in-tfs-build-vnext/","summary":"\u003cp\u003eSince a couple of months back, Microsoft new \u003ca href=\"/2015/12/microsoft-announces-next-generation-of-visual-studio-release-management/\"\u003eRelease Management servic\u003c/a\u003ee is available in public preview in Visual Studio Team Services. According to the current time plan, it will be released for on-premise TFS in the next update (Update 2).\u003c/p\u003e\n\u003cp\u003eUsing a tool like release management allows you to implement a deployment pipeline by grabbing the binaries and any other artifacts from your release build, and then deploy them across different environments with the proper configuration and approval workflow. Building your binaries once and only once is a fundamental principal of implementing continuous delivery, too much can go wrong if you build your application every time you deploy it into a new environment.\u003c/p\u003e","title":"Downloading Build Artifacts in TFS Build vNext"},{"content":"Jakob has published three books in the area of Visual Studio ALM:\nContinuous Delivery with Visual Studio 2015 (Apress - 2015)\n(With Mathias Olausson)\nThis book is the authoritative source on implementing Continuous Delivery practices using Microsoft’s Visual Studio and TFS 2015. Microsoft MVP authors Mathias Olausson and Jakob Ehn translate the theory behind this methodology and show step by step how to implement Continuous Delivery in a real world environment.\nPro Team Foundation Service (Apress - 2013)\n(Co-authored with Mathias Olausson, Mattias Sköld and Joakim Rossberg)\nPro Team Foundation Service gives you a jump-start into Microsoft’s cloud-based Application Lifecycle Management platform, taking you through the different stages of software development. Every project needs to plan, develop, test and release software and with agile practices often at a higher pace than ever before.\nTeam Foundation Server 2012 Starter (Packt Publishing - 2012)\n(Co-authored with Terje Sandstrøm)\nTeam Foundation Server 2012 is Microsoft\u0026rsquo;s leading ALM tool, integrating source control, work item and process handling, build automation, and testing.\nThis practical \u0026ldquo;Team Foundation Server 2012 Starter Guide\u0026rdquo; will provide you with clear step-by-step exercises covering all major aspects of the product. This is essential reading for anyone wishing to set up, organize, and use TFS server.\n","permalink":"https://blog.ehn.nu/books/","summary":"\u003cp\u003eJakob has published three books in the area of Visual Studio ALM:\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003e\u003cstrong\u003e\u003ca href=\"http://www.amazon.com/Continuous-Delivery-Visual-Studio-2015/dp/1484212738\"\u003eContinuous Delivery with Visual Studio 2015\u003c/a\u003e (\u003cem\u003eApress - 2015\u003c/em\u003e)\u003c/strong\u003e\u003cbr\u003e\n(With \u003ca href=\"http://blogs.msmvps.com/molausson/\"\u003eMathias Olausson\u003c/a\u003e)\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eThis book is the authoritative source on implementing Continuous Delivery practices using Microsoft’s Visual Studio and TFS 2015. Microsoft MVP authors Mathias Olausson and Jakob Ehn translate the theory behind this methodology and show step by step how to implement Continuous Delivery in a real world environment.\u003c/em\u003e\u003c/p\u003e","title":"Books"},{"content":"Jakob is a current Microsoft Azure MVP (former Visual Studio/ALM MVP) and also a Visual Studio ALM Ranger. Jakob has over 15 years of experience in the IT industry, and currently works as a senior developer and cloud solution architect at Active Solution in Stockholm, Sweden, specializing in Cloud Archicture and DevOps.\nJakob has published several books on the topic of DevOps on the Microsoft stack, read more about them here.\nHe has also spoken on several different conferences and user groups, including DevSum, TechDays, WinOps and NDC. Read about upcoming and past speaking engagement here\n","permalink":"https://blog.ehn.nu/about-me/","summary":"\u003cp\u003eJakob is a current  \u003ca href=\"https://mvp.microsoft.com/en-us/PublicProfile/4039620?fullName=Jakob%20Ehn\"\u003eMicrosoft Azure MVP\u003c/a\u003e (former Visual Studio/ALM MVP) and also a \u003ca href=\"http://blogs.msdn.com/b/willy-peter_schaub/archive/2011/11/10/introducing-the-visual-studio-alm-rangers-jakob-ehn.aspx\"\u003eVisual Studio ALM Ranger\u003c/a\u003e. Jakob has over 15 years of experience in the IT industry, and currently works as a senior developer and cloud solution architect at \u003ca href=\"http://activesolution.se\"\u003eActive Solution\u003c/a\u003e in Stockholm, Sweden, specializing in Cloud Archicture and DevOps.\u003c/p\u003e\n\u003cp\u003e\u003cimg alt=\"Jakob\u0026rsquo;s Profile\" loading=\"lazy\" src=\"/about-me/profile_small-300x243.jpg\"\u003e\u003c/p\u003e\n\u003cp\u003eJakob has published several books on the topic of DevOps on the Microsoft stack, read more about them \u003ca href=\"http://blog.ehn.nu/books/\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eHe has also spoken on several different conferences and user groups, including DevSum, TechDays, WinOps and NDC. Read about upcoming and past speaking engagement \u003ca href=\"http://blog.ehn.nu/speaking/\"\u003ehere\u003c/a\u003e\u003c/p\u003e","title":"About Me"},{"content":"\nThis december we at Active Solution team up with Microsoft Sweden to deliver a full day of Azure and Internet of Things (IoT) goodness in 4 different cities around Sweden:\nMalmö – Dec 1- Göteborg – Dec 2- Umeå – Dec 8- Stockholm – Dec 9 This is a unique opportunity for devlopers, startups and students that want to learn more about what Microsoft Azure has to offer and how you can implement IoT solutions together with Azure.\nThe day will be a mixture of sessions, discussions and hands-on labs where you will have the chance to try out these technologies in practice, just bring your Windows 10 laptop with Visual Studio 2015 and the Azure SDK installed, and make sure that you also have an active Azure subscription (an evaluation subscription will be fine)\nFrom Active Solution, myself and Robert Folkesson will host the second part of the day, where we will guide you through the hands-on labs.\nRead more and sign up for the event at http://devroadshow.net/\nHope to see you there!\n","permalink":"https://blog.ehn.nu/2015/12/microsoft-developer-roadshow-sweden-with-active-solution/","summary":"\u003cp\u003e\u003ca href=\"image7.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2015/12/microsoft-developer-roadshow-sweden-with-active-solution/image_thumb7.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eThis december we at \u003ca href=\"http://activesolution.se\"\u003eActive Solution\u003c/a\u003e team up with Microsoft Sweden to deliver a full day of Azure and Internet of Things (IoT) goodness in 4 different cities around Sweden:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eMalmö\u003c/strong\u003e – Dec 1- \u003cstrong\u003eGöteborg\u003c/strong\u003e – Dec 2- \u003cstrong\u003eUmeå\u003c/strong\u003e – Dec 8- \u003cstrong\u003eStockholm\u003c/strong\u003e – Dec 9\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThis is a unique opportunity for devlopers, startups and students that want to learn more about what Microsoft Azure has to offer and how you can implement IoT solutions together with Azure.\u003c/p\u003e","title":"Microsoft Developer Roadshow Sweden with Active Solution"},{"content":"Today at the Microsoft Connect() event, Microsoft announced the public preview of the brand new version of Visual Studio Release Management. The public preview is available on Visual Studio Team Services (a.k.a. Visual Studio Online, in case you missed that announcement! :-)), and will debut on premise later in 2016.\nSo, what’s this new version about? Let’s summarize some of the major features about it:\nWeb Based The existing version of Visual Studio Release Management, that was originally acquired from InCycle back in 2013, uses a standalone WPF client for authoring, triggering and tracking releases. It always felt a bit awkward and wasn’t really integrated with the rest of TFS. The new version is completely rewritten to be a web based experience and is part of the web access, as a new “Release” tab.\nFrom this hub you can author release definitions, manage approval workflows and trigger and track releases.\nShared Infrastructure with TFS Build With the new build system in TFS 2015, Microsoft already has a great automation platform that is scriptable, cross platform and easy to deploy and configure. So it makes sense that the new version of Visual Studio Release Management is build upon the same platform. So the build agent that is used for running builds can also be used for executing releases.\nIt also means that all the new build tasks that are available in TFS Build 2015 and also be used as part of a release pipeline.\nCross Platform Support As mentioned above, since the same agent is used for releases, it means that we can also run them on Linux and OS/X since these are supported platforms. There are many tasks out of the box for doing cross platform deployment, including Chef and Docker.\nTrack Releases across Environments The new web UI makes it easy to get an overview of the status of your existing environments, and which version of which application that is currently deployed. In the example below we can see that the new release of the “QuizBox” application has been deployed to Dev and QA, has gone through automated and manual acceptance tests, and is currently being deployed to the staging slot of the production environment.\nConfiguration Management One of the biggest challenges with doing staged deployments is the configuration management. The different environment often have different configuration settings, things like connection strings, account names and passwords. In Visual Studio Release Management vNext these configuration variables can be authored either on the environment level or on the release definition level, where it applies to all environments.\nWe can easily compare the configuration variables across our environments, as shown below.\nLive Release Log Output As with the new build system in TFS 2015, VSRM vNext gives you excellent real time logging from the release agent, as the release is executing. \\\nRelease Approval Every environment in the release pipeline can trigger approvals, either before the deployment starts or after. For example, before we want to deploy a new version of an application to the QA environment, the QA team should be able to approve it to make sure that the environment is ready.\nBelow you can see a release that has a pending approval. Every approver that should take action will receive a notification email with a link to this page.\nDo you want to learn more? For the last 6 months, me and my fellow ALM MVP and good friend Mathias Olausson have been busy working on a book that covers among other things this new version of Visual Studio Release Management. The title of the book is Continuous Delivery with Visual Studio ALM 2015, and covers how the process of continuous delivery can be implemented using the Visual Studio 2015 ALM tool suite.\nI will write a separate blog post about the book, but here is the description from Amazon:\nThis book is the authoritative source on implementing Continuous Delivery practices using Microsoft’s Visual Studio and TFS 2015. Microsoft MVP authors Mathias Olausson and Jakob Ehn translate the theory behind this methodology and show step by step how to implement Continuous Delivery in a real world environment.\n*Building good software is challenging. Building high-quality software on a tight schedule can be close to impossible. Continuous Delivery is an agile and iterative technique that enables developers to deliver solid, working software in every iteration. Continuous delivery practices help IT organizations reduce risk and potentially become as nimble, agile, and innovative as startups. *\nIn this book, you\u0026rsquo;ll learn:\n*What Continuous Delivery is and how to use it to create better software more efficiently using Visual Studio 2015 *- *How to use Team Foundation Server 2015 and Visual Studio Online to plan, design, and implement powerful and reliable deployment pipelines *- Detailed step-by-step instructions for implementing Continuous Delivery on a real project You can find the book at http://www.amazon.com/Continuous-Delivery-Visual-Studio-2015/dp/1484212738.\nWe hope that you will find it valuable!\n","permalink":"https://blog.ehn.nu/2015/12/microsoft-announces-next-generation-of-visual-studio-release-management/","summary":"\u003cp\u003eToday at the Microsoft Connect() event, Microsoft announced the public preview of the brand new version of Visual Studio Release Management. The public preview is available on \u003cem\u003e\u003cstrong\u003eVisual Studio Team Services\u003c/strong\u003e\u003c/em\u003e (a.k.a. \u003cem\u003eVisual Studio Online\u003c/em\u003e, in case you missed that announcement! :-)), and will debut on premise later in 2016.\u003c/p\u003e\n\u003cp\u003eSo, what’s this new version about? Let’s summarize some of the major features about it:\u003c/p\u003e\n\u003ch2 id=\"web-based\"\u003eWeb Based\u003c/h2\u003e\n\u003cp\u003eThe existing version of Visual Studio Release Management, that was originally acquired from InCycle back in 2013, uses a standalone WPF client for authoring, triggering and tracking releases. It always felt a bit awkward and wasn’t really integrated with the rest of TFS. The new version is completely rewritten to be a web based experience and is part of the web access, as a new “Release” tab.\u003c/p\u003e","title":"Microsoft Announces Next Generation of Visual Studio Release Management"},{"content":"With today’s announcement at Microsoft Connect() about the public preview of the next generation of Visual Studio Release Management, it is also time to announce the (imminent) release of a new book that covers among other things this new version of RM.\nMe and my fellow ALM MVP Mathias Olausson have been working hard during the last 6 months on this book, using early alpha and beta versions of this brand new version of Visual Studio Release Management. Writing about a changing platform can be rather challenging, and our publisher (Apress) have been very patient with us regarding delays and late changes!\nAbout the book The book is titled Continuous Delivery with Visual Studio ALM 2015 and is aiming to be a more practical complement to Jez Humble’s seminal Continous Delivery book with a heavy focus of course on how to implement these processes using the Visual Studio ALM platform.\nThe book discusses the principles and practices around continuous delivery and continuous deployment, including release planning, source control management, build and test automation and deployment pipelines. The book uses a fictive sample application that we use throughout the book as a concrete example on how to go about to implement a continuous delivery workflow on a real application.\nWe hope that you will find this book useful and valuable!\nAbstract This book is the authoritative source on implementing Continuous Delivery practices using Microsoft’s Visual Studio and TFS 2015. Microsoft MVP authors Mathias Olausson and Jakob Ehn translate the theory behind this methodology and show step by step how to implement Continuous Delivery in a real world environment.\nBuilding good software is challenging. Building high-quality software on a tight schedule can be close to impossible. Continuous Delivery is an agile and iterative technique that enables developers to deliver solid, working software in every iteration. Continuous delivery practices help IT organizations reduce risk and potentially become as nimble, agile, and innovative as startups.\nIn this book, you\u0026rsquo;ll learn:\nWhat Continuous Delivery is and how to use it to create better software more efficiently using Visual Studio 2015 - How to use Team Foundation Server 2015 and Visual Studio Online to plan, design, and implement powerful and reliable deployment pipelines - Detailed step-by-step instructions for implementing Continuous Delivery on a real project Table of Content Chapter 1: Introduction to Continuous Delivery Chapter 2: Overview of Visual Studio 2015 ALM Chapter 3: Designing an Application for Continuous Delivery Chapter 4: Managing the Release Process Chapter 5: Source Control Management Chapter 6: PowerShell for Deployment Chapter 7: Build Automation Chapter 8: Managing Code Quality Chapter 9: Continuous Testing Chapter 10: Building a Deployment Pipeline Chapter 11: Measure and Learn\n","permalink":"https://blog.ehn.nu/2015/12/new-book-continuous-delivery-with-visual-studio-alm-2015/","summary":"\u003cp\u003eWith today’s announcement at Microsoft Connect() about the public preview of the next generation of Visual Studio Release Management, it is also time to announce the (imminent) release of a new book that covers among other things this new version of RM.\u003c/p\u003e\n\u003cp\u003eMe and my fellow ALM MVP \u003ca href=\"http://blogs.msmvps.com/molausson/\"\u003eMathias Olausson\u003c/a\u003e have been working hard during the last 6 months on this book, using early alpha and beta versions of this brand new version of Visual Studio Release Management. Writing about a changing platform can be rather challenging, and our publisher (\u003ca href=\"https://www.apress.com/\"\u003eApress\u003c/a\u003e) have been very patient with us regarding delays and late changes!\u003c/p\u003e","title":"New Book – Continuous Delivery with Visual Studio ALM 2015"},{"content":"Anyone that has been involved with setting up the infrastructure that is needed to perform on premise load testing of a realistic number of users knows how much work that is to both setup and to maintain. With Visual Studio Ultimate/Enterprise you needed to create a test rig by creating multiple machines and then installing a test controller and test agents on all the machines and configure them to talk to each other.\nAnother aspect of if is that the typical team don’t run load tests of their applications on a regular basis, instead it is done during certain periods or sprints during the lifecycle of the project. So the rest of time those machines aren’t used for anything, so basically they are just using up your resources.\nCloud Load Testing With the introduction of Cloud Load Testing, that is part of Visual Studio Online, Microsoft added the possibility to use Azure for generating the load for your tests. This means that you no longer have to setup or configure any agents at all, you only need to specify the type of load that you want, such as the number of users and for how long the test should run. This makes it incredibly easy to run load tests, and you only pay for the resources that you use. You can even use it to test internal application running behind a firewall.\nSo, this feature has been around for a couple of years, but there has always been a problem with discoverability due to it being available only from inside the Visual Studio Online portal. So for teams that uses Azure for running web apps but are not using Visual Studio Online for their development, they would most likely never see or use this feature.\nBut back in September Microsoft announced the public preview of perfomance testing Azure Web Apps, fully integrated in the Azure Portal. It still needs a connection to a Visual Studio Online account, but as you will see this can easily be done as part of setting up the first performance test.\nLet’s take a quick look at how to create and run a performance test for an Azure Web App.\nAzure Web App Performance Test The new Performance Test functionality is available in the Tools blade for your web app, so go ahead and click that.\nThe first time you do this, you will be informed that you need to either create a Visual Studio Account or link to an existing one. Here I will create a new one called jakobperformance.\nNote that:\nIt must have a unique name since this will end up as .visualstudio.com) It does not mean that you have to use this account (or any other VSO account for that matter) for your development. Currently the location must be set to South Central US, this is most likely only the case during the public preview.\nWhen you do this, you will receive a nice little email from Microsoft that includes a lot of links to more information about how to get started with cloud load testing.\nA simple thing really, but things like this can really make a difference when you are trying a new technology for the first time.\nSo, once we have create or linked the VSO account we can go ahead and create a new performance test. Here is the information that you need to supply:\nURL The public URL that the performance test should hit. It will be default be set to the URL of the current Azure Web App, but you can change this.\nName The name of this particular test run. As you will see, all test runs are stored and available in the Performance Test blade of your Azure Web App, so give it a descriptive name.\n**Generate Load From **Here you select from which region that the load should be generated from. Select the one that most closely represent the origin of your users.\nUser Load The number of users that should hit your site. While this feature is in public preview you don’t have to pay for running these load tests, but there will some limits in how much load you can generate. You can contact Microsoft if you need to increase this limit during the preview period.\nDuration (Minutes) Specifies for how long (in minutes) that the load test should run\nOnce this is filled out, hit Run Test to start the load test. This will queue the performance test and then start spinning up the necessary resources in Azure for running the load test.\nClicking on the test run, you will see information start to come in after a short period of time, showing the number of requests generated and some key performance characteristics of how your application behaves under pressure.\nOf course, this type of load testing doesn’t cover all you need in terms of creating realistic user load, but it is a great way to quickly hit some key pages of your site and see how it behaves. then you can move on and author more complex load tests using Visual Studio Enterprise, and run them using Azure as well.\nGo ahead and try it out for yourself, it couldn’t be easier and during the public preview it is free of charge!\nComments Imported from the original WordPress site. Closed for new replies.\nChintan Shah — 05 Nov 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/11/02/performance-tests-for-azure-web-apps.aspx#646934\nNice and technical information regarding Azure Web App Performance Test!!\nThanks!!\n","permalink":"https://blog.ehn.nu/2015/11/performance-tests-for-azure-web-apps/","summary":"\u003cp\u003eAnyone that has been involved with setting up the infrastructure that is needed to perform on premise load testing of a realistic number of users knows how much work that is to both setup and to maintain. With Visual Studio Ultimate/Enterprise you needed to create a test rig by creating multiple machines and then installing a test controller and test agents on all the machines and configure them to talk to each other.\u003c/p\u003e","title":"Performance Tests for Azure Web Apps"},{"content":"I often talk to different teams about how they work with Team Foundation Server or Visual Studio Online. I get a lot of questions about different features, and some of them tend to come up more often than other. So here is a list of 10 features in TFS that I get questions about regularly or that I have noticed a lot of teams don’t know about. It is by no means exhaustive, and it is a mixture of smaller and larger features, but hopefully you will find something here that you didn’t know about before.\n1. Associate Work Items in Git commits from any client Associating work items to your changesets in TFS have always been one of the more powerful features. Not in itself, but in the traceability that this gives us. Without this, we would have to rely on check-in comments from the developers to understand the reason for a particular change, not always easy when you look at changes that were done a few years back!\nWhen using Git repos in TFS, and you use the Git integration in Visual Studio you have the same functionality that lets you associate a work item to a commit, either by using a work item query or by specifying a work item ID.\nBut a lot of developers like to use other Git tooling, such as Git Extensions, SourceTree or the command line. And then we have the teams that work on other platforms, perhaps developing iOS apps but store their source code in a Git repo in TFS. They obviously can’t use Visual Studio for committing their changes to TFS.\nTo associate a commit with a work item in these scenarios, you can simply enter the ID of the work item with a # in front of it as part of the commit message:\ngit commit –a –m “Optimized query processing #4321” Here we associate this commit with the work item with ID 4321. Note that since Git commits are local, the association won’t actually be done until the commit has been pushed to the server. TFS processes git commits for work item association asynchronously, so it could potentially take a short moment before the association is done.\n2. Batch update work items from the Web Access Excel has always been a great tool for updating multiple work items in TFS. But over the years the web access in TFS has become so much better so that most people do all their work related to work item management there. And unfortunately, it is not possible to export work item queries to Excel as easily from the web as it is from Visual Studio.\nBut, we can update multiple work items in TFS web access as well. These features have gradually been added to Visual Studio Online and is now part of TFS 2015 as well.\nFrom the product backlog view, we can select multiple work items and the perform different operations on them, as shown below:\nThere are a few shortcut operations for very common tasks such as moving multiple backlog items to a iteration, or assigning them to a team member. But then you have the Edit selected work item(s) that allows us to set any fields to a new value in one operation. \\\nYou can also do this from the sprint backlog and from the result list of a work item query.\n3. Edit and commit source files in your web browser Working with source code is of course done best from a development IDE such as Visual Studio. But sometimes it can be very convenient to change a file straight from the web access, and you can! Maybe you find a configuration error when logged on a staging environment where you do not have access to Visual Studio. Then you can just browse to the file in source control and change it using the Edit button:\nAfter making the changes, you can add a meaning commit message and commit the change back to TFS. When using Git, you can even commit it to a new branch.\n4. Bring in your stakeholders to the team using the free Stakeholder license Normally, every team member that accesses TFS and reads or writes information to it (source code, work items etc) need to have a Client Access License (CAL). For the development team this is usually not a problem, often they already have a Visual Studio with MSDN subscription in which a TFS CAL is included. What often cause some friction is when the team try to involve the stakeholders. Stakeholders often include people who just want to track progress or file a bug or a suggestion occasionally. Buying a CAl for every person in this role usually ends up being way to expensive and not really worth it.\nIn TFS 2013 Update 4 this was changed, from that point people with a stakeholder license does not a CAL at all, they can access TFS for free. Buth they still have a limited experience, they can’t do everything that a normal team member can. Features that a stakeholder can use include:\nFull read/write/create on all work items Create, run and save (to “My Queries”) work item queries View project and team home pages Access to the backlog, including add and update (but no ability to reprioritize the work) Ability to receive work item alerts To learn more about the Stakeholder license, see https://msdn.microsoft.com/Library/vs/alm/work/connect/work-as-a-stakeholder\n5. Protect your Git branches using branch policies When using Team Foundation Version Control (TFVC) we have from the first version of TFS had the ability to use check-in policies for enforcing standards and policies of everything that is checked in to source control. We also have the ability to use Gated Builds, which allows us to make sure that a changeset is not checked in unless an associated build definition is executed successfully.\nWhen Git was added to TFS back in 2013, there was no corresponding functionality available. But in TFS 2015 now, the team has added branch policies as a way to protect our branches from inadvertent or low quality commits. In the version control tab of the settings administration page you can select a branch from a Git repo and then apply branch policies. The image below shows the available branch policies.\nimage Here we have enabled all three policies, which will enforce the following:\nAll commits in the master branch must be made using a pull request \\ The commits in the pull request must have associated work items \\ The pull request must be reviewed by at least two separate reviewers \\ The QBox.CI build must complete successfully before the pull request can be merged to the master branch I really recommend that you start using these branch policies, they are an excellent way to enforce the standard and quality of the commits being made, and can help your team improve their process and help move towards being able to deliver value to your customers more frequently.\n6. Using the @CurrentIteration in Work Item Queries Work Item Queries are very useful for retrieving the status of your ongoing projects. The backlogs and boards are great in TFS for managing the sprints and requirements, but the ability to query on information across one ore more projects are pivotal. Work item queries are often used as reports and we can also create charts from them.\nVery often, we are interested in information in the current sprint, for example how many open bug are there, how many requirements do we have that doesn’t have associated test cases and so on. Before TFS 2015, we had to write work item queries that referenced the current sprint directly, like so:\nThe problem with this was of course that as soon as the sprint ended and the next one started, we hade to update all these queries to reference the new iteration. Some people came up with smart work arounds, but it was still cumbersome.\nEnter the @CurrentIteration token. This token will evaluate to the currently sprint which means we can define our queries once and they will continue to work for all upcoming sprints as well.\nthis token is unfortunately not yet available in Excel since it is not team-aware. Since iterations are configured per team, it is necessary to evaluate this token in the context of a team. Both the web access and Visual Studio have this context, but the Excel integration does not, yet.\nLearn more about querying using this token at https://msdn.microsoft.com/en-us/Library/vs/alm/Work/track/query-by-date-or-current-iteration\n7. Pin Important Information to the home page The new homepage has been available since TFS 2012, and I still find that most teams does not use the possibility to pin important information to the homepage enough. The homepage is perfect to show on a big screen in your team room, at least if you show relevant information on it.\nWe can pin the following items to the home page:\n**Work Item Queries **The tile will show the number of work items returned by the query . Focus on pinning queries where the these numbers are important and can trigger some activity. E.g. not the total number of backlog items, but for example the number of active bugs. \\ **Build Definition **This tile shows a bar graph with the history of the last 30 builds. Gives a good visualization of how stable the builds are, if you see that builds fails every now and then you have a problem that needs to be investigated. \\ **Source control **Shows the number of recent commits or changesets. Will let you know how much activity that is going on in the different repos \\ Charts Charts can be created from work item queries and can also be pinned to the home page. Very useful for quickly give an overview of the status for a particular area Here is an example where we have added a few items of each type\n8. Query on Work Item Tags Support for tagging was first implemented back in TFS 2012 Update 2. This allowed us to add multiple tags to work items and then filter backlogs and query results on these tags. There was however a big thing missing and that was the ability to search for work items using tags.\nThis has been fixed since TFS 2013 Update 2, which means we can now create queries like this.\nIt is also possible to work with tags using Excel, this was another big thing missing from the start.\nUnfortunately it is not yet possible to setup alerts on tags, you can vote on this feature on UserVoice here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6059328-use-tags-in-alerts\n9. Select how you want to handle bugs One of the most common questions I get when talking to teams that use TFS is how they should handle bugs. Some teams want to have the bugs on the backlog and treat them like requirements. Other teams want to treat them more like tasks, that is adding them to the corresponding user story or backlog item and use the task board to keep track of the bug.\nThe good think is that you can configure this per team now. On the team settings page, there is a section that lets you configure the behavior of bugs.\nTo learn more about controlling the behavior of bugs, see https://msdn.microsoft.com/Library/vs/alm/work/customize/show-bugs-on-backlog\n10. Integrate with external or internal services using Service Hooks Extensibility and integration are very important to Microsoft these days, and this is very clear when looking at the investments for TFS 2015 that included a bunch of work in this area. First of all Microsoft has added a proper REST API for accessing and updating most of the available artifacts in TFS, such as work items and builds. It uses OAuth 2.0 for authentication, which means it is based on open modern web standards and can be used from any client on any platform.\nIn addition to this, TFS 2015 also support Service Hooks. A service hook is basically a web endpoint that can be called when something happens, in this case in TFS. So for example, when a backlog item is created in TFS we might want to also create a card in Trello. Or when a new change is committed into source control, we might want to kick off a Jenkins build.\nHere is a list of the services that are supported out of the box in TFS 2015:\nAnd the list keeps growing, in Visual Studio Online there are already 7 more services offered, including AppVeyor, Bamboo and MyGet.\nNote that the list contains one entry called Web Hooks. This is a general service configuration in which you can configure a HTTP POST endpoint that will receive messages for the events that you configure. The messages can be sent using JSON, MarkDown, HTML or text. This mean that you can also integrate with internal services, if they expose HTTP REST endpoints.\nTo learn more about service hooks, see https://www.visualstudio.com/en-us/integrate/get-started/service-hooks/create-subscription\n","permalink":"https://blog.ehn.nu/2015/10/10-features-in-team-foundation-server-that-you-maybe-didnt-know-about/","summary":"\u003cp\u003eI often talk to different teams about how they work with Team Foundation Server or Visual Studio Online. I get a lot of questions about different features, and some of them tend to come up more often than other. So here is a list of 10 features in TFS that I get questions about regularly or that I have noticed a lot of teams don’t know about. It is by no means exhaustive, and it is a mixture of smaller and larger features, but hopefully you will find something here that you didn’t know about before.\u003c/p\u003e","title":"10 Features in Team Foundation Server that you maybe didn’t know about"},{"content":"By now, many of you should have had the chance to at least play with the new build system that was released in TFS 2015 and Visual Studio Online. Here is an introductory post I wrote about it when it entered public preview back in January.\nDoing the basic stuff is very easy using the new build system, especially if you compare it with the old one, which is now referred to as XAML builds. Creating and customizing build definitions is just a matter of adding the tasks that you want to use and configure them properly, everything is done using the web interface that is part of the TFS Web Access.\nBuild Number Format There are (of course) still some things that are not completely obvious how to do. One of these things is how to generate a custom build number for a build. Every build definition has a build number format field where you can use some macros to dictate what the resulting build number should look like.\nThe build number format can contain a mix of text and macros, in the above example I have used some of the date macros to generate a build number that uses todays date plus an increment at the end.\nGenerating a custom build number Sometimes though you will have the requirement to generate a completely custom build number, based on some external criteria that is not available using these macros.\nThis can be done, but as I mentioned before, it is not obvious! TFS Build contains a set of logging commands that can be used to generate output from a task /typically a script) that is generated in a way so that TFS Build will interpret this as a command and perform the corresponding action. Let’s look at some examples:\n##vso[task.logissue type=error;sourcepath=someproject/controller.cs;linenumber=165;columnumber=14;code=150;]some error text here\nThis logging command can be used to log an error or a warning that will be added to the timeline of the current task. To generate this command, you can for exampleuse the following \u0026lsquo;PowerShell script:\nWrite-Verbose –Verbose “##vso[task.logissue type=error;sourcepath=someproject/controller.cs;linenumber=165;columnumber=14;code=150;]some error text here”\nAs you can see, there is a special format that is used for these commands: ##vso[command parameters]text. This format allows the build agent to pick up this command and process it.\nNow, to generate a build number, we can use the task.setvariable command and set the build number, like so:\n##vso[task.setvariable variable=build.buildnumber;]1.2.3.4\nThis will change the build number of the current build to 1.2.3.4. Of course, you would typically generate this value from some other source combined with some logic to end up with a unique build number.\nYou can find the full list of logging commands at https://github.com/Microsoft/vso-agent-tasks/blob/master/docs/authoring/commands.md\nComments Imported from the original WordPress site. Closed for new replies.\nMichael J. Prentice — 04 Nov 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/10/15/generate-custom-build-numbers-in-tfs-build-vnext.aspx#646930\nThank you very much, just what I was looking for!\nNote, to update the build number within TFS or VSO, I had to add this on top of having it set the variable.\nWrite-Verbose -Verbose \u0026ldquo;##vso[build.updatebuildnumber]1.2.3.4\u0026rdquo;\nRyan — 09 May 2016\nI get this:\nUnable to process logging event:##vso[build.updatebuildnumber]1.2.3.4\nThis command works:\n##vso[task.setvariable variable=build.buildnumber]1.2.3.4\nBut that does not update the list of builds :|\nZvi Moskovitz — 16 May 2016\nCan you please show how the ps file is looks like, i\u0026rsquo;m not familier with PS.\nAnd how to run iyt in TFS v2015.\nThanks\nZvi\nZvi — 23 May 2016\nI did it and it works, but the $Rev didnt increased by one, what am i missing here?\nRyan — 09 May 2016\nI get this:\nUnable to process logging event:##vso[build.updatebuildnumber]1.2.3.4\nThis command works:\n##vso[task.setvariable variable=build.buildnumber]1.2.3.4\nBut that does not update the list of builds :|\ndean — 24 Aug 2017\nI had to use:\n\u0026ldquo;##vso[build.updatebuildnumber]1.2.3.4\u0026rdquo;\n","permalink":"https://blog.ehn.nu/2015/10/generate-custom-build-numbers-in-tfs-build-vnext/","summary":"\u003cp\u003eBy now, many of you should have had the chance to at least play with the new build system that was released in TFS 2015 and Visual Studio Online. \u003ca href=\"http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx\"\u003eHere is an introductory post I wrote about it\u003c/a\u003e when it entered public preview back in January.\u003c/p\u003e\n\u003cp\u003eDoing the basic stuff is very easy using the new build system, especially if you compare it with the old one, which is now referred to as XAML builds. Creating and customizing build definitions is just a matter of adding the tasks that you want to use and configure them properly, everything is done using the web interface that is part of the TFS Web Access.\u003c/p\u003e","title":"Generate custom build numbers in TFS Build vNext"},{"content":"I finally got around to upgrading the Inmeta AssociateRecentWorkItems extension to support Visual Studio 2015. Several people have contacted me about this, sorry that it took so long!\nAbout the extension This extension makes it easy to associate multiple checkins with the same work items, as it shows a list of the recently associated work items from which you can easily associate one with the current pending changes.\nAssociating work items\nNote about the rebranding At the same time, I rebranded this extension to use the Osiris brand. Osiris being the company that I originally worked, before it was acquired by Inmeta. Now I don’t work for Inmeta anymore, so me and my former colleague Terje Sandström decided to bring back the Osiris name and created a GitHub account for it called OsirisOS (OS for open source then…).\nIt’s available over at https://github.com/OsirisOS and currently contain one repo for the AssociateRecentWorkItems extension. Hopefully we will add more cool and useful projects around Visual Studio ALM here, if you are interested in contributing, let us know!\nThe Osiris logotype\nSo, the extension is now called Osiris AssociateRecentWorkItems and is available at https://visualstudiogallery.msdn.microsoft.com/3fa82205-e0f0-4874-a38b-023435fa2802\nHope that you will find it useful. I do plan to add support for Git, when I get around to it! Please poke me if you want it done sooner than later.. :-)\n","permalink":"https://blog.ehn.nu/2015/08/associaterecentworkitems-extension-available-for-visual-studio-2015/","summary":"\u003cp\u003eI finally got around to upgrading the \u003ca href=\"https://visualstudiogallery.msdn.microsoft.com/038cef01-98c1-46bd-844b-8080b711791c\"\u003eInmeta AssociateRecentWorkItems\u003c/a\u003e extension to support Visual Studio 2015. Several people have contacted me about this, sorry that it took so long!\u003c/p\u003e\n\u003ch3 id=\"about-the-extension\"\u003eAbout the extension\u003c/h3\u003e\n\u003cp\u003eThis extension makes it easy to associate multiple checkins with the same work items, as it shows a list of the recently associated work items from which you can easily associate one with the current pending changes.\u003c/p\u003e\n\u003cp\u003e\u003cimg alt=\"Osiris AssociateRecentWorkItems VS2015\" loading=\"lazy\" src=\"https://visualstudiogallery.msdn.microsoft.com/3fa82205-e0f0-4874-a38b-023435fa2802/image/file/176045/1/screenshot.png?Id=176045\"\u003e\u003c/p\u003e","title":"AssociateRecentWorkItems Extension available for Visual Studio 2015"},{"content":"In the brave new world of Microsoft where a lot of the frameworks and languages that they build now are open sourced over at GitHub, it comes as no surprise that GitHub is nicely integrated into both Visual Studio and TFS Build vNext. This makes it very easy to setup builds that gets the source code from your GitHub repo but uses TFS Build vNext to build it. It also allows you to setup CI builds, that is builds that trigger automatically when someone does a commit in the corresponding Git repo.\nLet’s see how this work: First, you’ll need a GitHub repo of course. Note: If you haven’t checked out the GitHub for VisualStudio extension yet, try it out. Makes it easy to clone your existing repos as well as creating new ones, right inside Visual Studio. *Clone existing repos Create a new GitHub repo *\nHere, I create a FabrikamFiberTFS repo on GitHub where I’ll upload the code to \\\nNow, to enable the TFS Build vNext integration, you need to create a Personal Access Token in GitHub. To do this, click the Settings link below your profile image in GitHub, and then click on the Personal Access Token link: \\\nGive the access token a name that you will remember(!), and then give it these permissions: NOTE: In order to configure triggering CI builds, you must have admin permissions on the GitHub repo. \\\nSave it, and the copy the access token that is displayed. NOTE: Store this token somewhere safely, you will not be able to view it again. You probably want to setup a personal access token that works for all your GitHub repos, if so you need to remember this access token. \\\nNow, create a new build definition in your Visual Studio Online/TFS team project. Head over to the Repository tab, and select GitHub as your repository tab: \\\nPaste your token in the Access Token field. This will populate the Repository drop down and let you select amongst your existing GitHub repositories: You will also be able to select which branch that should be the default branch. \\\nTo enable continuous integration for your build definition, go to the Trigger tab and check the Continuous Integration checkbox. When saved, this build definition will now use the repo_hook permission against your GitHub repository to respond to commit events. \\\nSave you build definition, and commit a change to your GitHub repository. A new build should be queued almost immediately. \\\nWhen the build completes, you will see the associated commit as usual in the build summary. However, this commit link now points to the GitHub commit page instead: Clicking the link shows the commit in GitHub: \\\nTo round this up, we will add a Build Badge to our Welcome page to get an indication of the current status of the build. Go to the General tab, check the Badge enabled checkbox and save the build definition. This will expose a link that shows you the public URL to a dynamically generated icon that shows the status of the latest build for this particular build definition: \\\nGo to the home page and then to the Welcome page tab. If you haven’t created a welcome page yet, do so. Then add the following markdown to the page: \\\nFabrikamFiberTFS Build Status \\ In my case, the link looks like this:\nFabrikamFiberTFS Build Status \\ \\\nSave it and you will see a nice little badge showing the status of the latest build: \\\nComments Imported from the original WordPress site. Closed for new replies.\nGiulio Vian — 12 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/06/12/building-github-repositories-in-tfs-build-vnext.aspx#644742\nOne day I will move some CI from AppVeyor now that you worked out the details.\njosh — 10 Mar 2016\nHeya Jakob Ehn - thanks for the write up. Just to make sure i am not going nuts over here, this is only for VSO, and not on premise tfs, correct?\n","permalink":"https://blog.ehn.nu/2015/06/building-github-repositories-in-tfs-build-vnext/","summary":"\u003cp\u003eIn the brave new world of Microsoft where a lot of the frameworks and languages that they build now are open sourced over at GitHub, it comes as no surprise that GitHub is nicely integrated into both \u003cbr\u003e\nVisual Studio and TFS Build vNext. This makes it very easy to setup builds that gets the source code from your GitHub repo but uses TFS Build vNext to build it. It also allows you to setup CI builds, that is  \u003cbr\u003e\nbuilds that trigger automatically when someone does a commit in the corresponding Git repo.\u003c/p\u003e","title":"Building GitHub repositories in TFS Build vNext"},{"content":"TFS 2015 is around the corner, and with it comes a whole new build system. All the biggest pain points from the existing build system (now called “XAML builds”) are gone and instead we get a light weight build system with a web UI that makes it very easy to customize our build processes and that doesn’t perform a lot of magic such as redirecting your build output for example.\nIn this post, I will show you just how easy it is to setup a build that builds a standard ASP.NET web application, generates a web deploy package as part of the build and then pick up this package and deploys it to a Azure web site. As part of this, you will also see how smooth the integration with Azure is when it comes to connecting your subscription.\nSample Application For this blog post I will use the common FabrikamFiber sample application, the full source for this is available at https://fabrikam.codeplex.com/\nI have created a new team project called FabrikamFiber on my local TFS 2015 instance, and pushed the source to the default Git repo in this team project:\nSo, let’s see how we can build, test and deploy this application to Azure.\nRegister your Azure subscription in TFS First of all, you need to add your Azure Subscription to TFS. You only need to this once of course (or at least one per subscription in case you have several).\nThis is done on the collection level, by using the Services tab:\nClick the Add new Azure Subscription link on the top left. Now you need to enter the Subscription Id and the subscription certificate (you can use credential as well, but using the certificate option is more secure). To get this information, follow these steps:\nOpen a Windows PowerShell windows in administrative mode \\ Type Get-AzurePublishSettingsFile \\ This will open a web browser and automatically download your subscription file \\ Open the subscription file (named --credentials.publishsettings \\ In this file, locate the Subscription Id and the ManagementCertificate fields Now, copy these values into the Add Azure Subscription dialog:\nPress OK. After it is saved, you should see your subscription to the left and some general information:\nThat’s it, now we can crate a build definition for our application.\nCreate a Build Definition Go to the team project where the source is located and click on the Build Preview tab. Click on the + button to create a new vNext definition: Now you can select a definition template for your build definition. Go to the Deployment tab and select the Azure Website template:\nThis will create a build definition with three steps, one for build the solution, one for running all the tests and one for deploying a web site to Azure. Note: For this post, I disabled the test step since not all tests pass in the default FabrikamFiber solution.\nIf you take a look at the Visual Studio Build step, you can see the arguments that are passed to MSBuild\n/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=\u0026quot;$(build.stagingDirectory)\u0026quot;\nThese are standard MSBuild parameters for triggering and configuration web deploy during compilation. These specific settings will create a web deploy package and put it in the staging directory of the build definition.\nNow, over to the deployment step. Here you can see that you can select your Azure subscription that we registered before. In addition we give the web site a unique name, this name is what the public web site will be called,in this case it will be http://fabrikamfibervnext.azurewebsites.net. We also need to specify the Web Site Location for this web site.\nThe final parameter that we need to specify is the Package. By default it will fetch all zip files located in the staging directory. I want to deploy the FabrikamFiber.Web application, so I change this to $(build.stagingDirectory)FabrikamFiber.Web.zip.\nThat’s it! Save the build definition and queue a new build.After it has completed, you should see a log that looks something like this and you should have a web sites published in Azure. As you can see, all steps in the process are shown to the left and you can easily see the output from each step.\nDeploying Multiple Web Sites If you’re familiar with the FabrikamFiber sample solution, you know that it actually has two web applications in the same solution, FabrikamFiber.Web and Fabrikamfiber.Extranet.Web.\nSo, how do we go about to deploy both web sites as part of our build? Well, it couldn’t be easier really, just add a new Azure Web Site Deployment build step and reference the other web deploy package:\nThis will now first build the solution and then publish both web sites to Azure.\nSummary Now you have seen how easy it is to build and deploy web applications using TFS Build vNext.\nComments Imported from the original WordPress site. Closed for new replies.\nmanik — 06 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/04/29/deploying-an-azure-web-site-using-tfs-build-vnext.aspx#644162\nThis great post for us ,Thanks\nmanik — 06 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/04/29/deploying-an-azure-web-site-using-tfs-build-vnext.aspx#644163\nVery useful article and helps us.Thankkkks\nDavid Allen — 26 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/04/29/deploying-an-azure-web-site-using-tfs-build-vnext.aspx#645009\nThis was awesome! Thank you. I published an alternate scenario, elaborating on how to use an on-premises build agent with the new VSO (Visual Studio Online) cloud-based build definitions.\nArticle on TFS Build 2015\\\nMattC — 16 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/04/29/deploying-an-azure-web-site-using-tfs-build-vnext.aspx#645313\nWhat are the pre-req to be installed on the build machine for deployment to azure using vnext?\nTiang — 29 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/04/29/deploying-an-azure-web-site-using-tfs-build-vnext.aspx#645540\nFYI, you can also get your Azure Management certificate details off the Azure portal:\nhttps://manage.windowsazure.com/publishsettings\n\u0026hellip;I don\u0026rsquo;t know why that\u0026rsquo;s not a visible link on the azure portal. :)\nThanks for the info!\nArne Vandenberghe — 21 Aug 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/04/29/deploying-an-azure-web-site-using-tfs-build-vnext.aspx#645910\nI keep hitting an error\\\n##[error]No files were found to deploy with search pattern \u0026lsquo;C:acdb39f4cstagingPushHubApiService.zip\u0026rsquo;\\\nI would also like to deploy a javascript SPA, produced by a gulp task. Again, I can\u0026rsquo;t seem to locate the package to deploy, even though a zip should be available after an publish artifact step.\\\n","permalink":"https://blog.ehn.nu/2015/04/deploying-an-azure-web-site-using-tfs-build-vnext/","summary":"\u003cp\u003eTFS 2015 is around the corner, and with it comes a \u003ca href=\"http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx\"\u003ewhole new build system\u003c/a\u003e. All the biggest pain points from the existing build system (now called “XAML builds”) are gone and instead we get a light weight build system with a web UI that makes it very easy to customize our build processes and that doesn’t perform a lot of magic such as redirecting your build output for example.\u003c/p\u003e\n\u003cp\u003eIn this post, I will show you just how easy it is to setup a build that builds a standard ASP.NET web application, generates a web deploy package as part of the build and then pick up this package and deploys it to a Azure web site. \u003cbr\u003e\nAs part of this, you will also see how smooth the integration with Azure is when it comes to connecting your subscription.\u003c/p\u003e","title":"Deploying an Azure Web Site using TFS Build vNext"},{"content":"\nThis year I’ll be presenting at DevSum, which is the largest .NET conference in Sweden. I’ll be talking about Visual Studio Online, Microsoft cloud offering for your development projects. I will go through all the major features of VSO, such as source code hosting, agile planning tooling , automated builds, test management and integration with other 3rd party service such as Trello and AppVeyor. I will also talk about how you can migrate your existing projects to VSO\nI’ve inserted the abstract of the session below, you can find the full information here\nhttp://www.devsum.se/speaker/jakob-ehn/\nHope to see you there!\nMoving your development to the Cloud using Visual Studio Online Did you know that Visual Studio Online supports all aspects of your development process? In addition to keeping track of your source code (using Git or TFVC), you can manage your product- and sprint backlogs, run automated builds in the cloud, define and execute test plans and create and manage release pipelines using Visual Studio Release Management. On top of this, VSO integrates with several other popular services such as Jenkins, AppVeyor, Trello and CampFire, which means that you can move to VSO and still use other services in the ecosystem.\nIn this session we will do a complete tour of what Visual Studio Online has to offer, and discuss the differences and pros/cons compared with on premise. We will also talk about how you can go about to migrate your development to VSO.\n","permalink":"https://blog.ehn.nu/2015/02/speaking-at-devsum-2015/","summary":"\u003cp\u003e\u003ca href=\"https://gwb.blob.core.windows.net/jakob/WindowsLiveWriter/SpeakingatDevSum2015_82ED/VSO_2.png\"\u003e\u003cimg alt=\"VSO\" loading=\"lazy\" src=\"/2015/02/speaking-at-devsum-2015/VSO_thumb.png\" title=\"VSO\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eThis year I’ll be presenting at \u003ca href=\"http://www.devsum.se/\"\u003eDevSum\u003c/a\u003e, which is the largest .NET conference in Sweden. I’ll be talking about \u003ca href=\"http://www.visualstudio.com/\"\u003eVisual Studio Online\u003c/a\u003e, Microsoft cloud offering for your development projects. I will go through all the major features of VSO, such as source code hosting, agile planning tooling , automated builds, test management and integration with other 3rd party service such as Trello and AppVeyor. I will also talk about how you can migrate your existing projects to VSO\u003c/p\u003e","title":"Speaking at DevSum 2015"},{"content":"Update: The exension is now also available for Visual Studio 2015 Preview: https://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a\nGitFlow 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. GitFlow was introduced by Vincent Driessen in this post 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 sense to implement tooling support for the workflow, which Vincent added shortly after. His repo is available at https://github.com/nvie/gitflow, although it hasn’t been updated since 2012. However, several forks has been made, one of the most active is being developed by Peter van der Does at https://github.com/petervanderdoes/gitflow\nTo make GitFlow more approachable I decided to integrate the GitFlow toolset into Visual Studio, by extending Team Explorer. This makes it very easy to access the commands and lowers the learning curve a bit by making it available as a UI. Note that the extension includes the GitFlow scripts from Peter van der Does fork of GitFlow and uses them for every command, so it provides the exact same functionality as the GitFlow scripts does.\nInstallation Note: The extension requires Visual Studio 2013 Update 3 or higher\nYou’ll find the extension over at the Visual Studio Gallery, just search for GitFlow in the Extension and Updates Window. Or, download it from https://visualstudiogallery.msdn.microsoft.com/27f6d087-9b6f-46b0-b236-d72907b54683:\nInstall it and restart Visual Studio, as usual.\nUsing the extension When you connect to a Git repo in Visual Studio (either local or remote), you will see a new icon show up on the home page in Team Explorer:\nNow, if GitFlow is not installed on your machine you will be presented with the following message:\nBy clicking Install, the extension will copy the necessary files into the Git for Windows directory, and run the install script for GitFlow. You can check the installation details for GitFlow here https://github.com/nvie/gitflow/wiki/Windows\n(Note: Since copying files into the %ProgramFiles(x86)%Gitbin directory requires elevated priveledges, this is done by running this as a elevated Powershell script. You will see this flash by during the installation)\nInitialize Now, you are ready to start use the extension! The first thing you will have to do is to initialize the repo for GitFlow. What this means is that you should create your permanent development and master branches, and set the naming conventions for future feature, release and hotfix branches:\nYou can also set the Tag prefix, which will be used when you tag a release or hotfix branch as part of finishing up those branches.\nNote that all output from all GitFlow operations are sent to a separate output window pane in Visual Studio, which is activated when the command start. Here you can which gitflow command that were used and the output from it:\nWorking with features From now on, the extension will show the recommended actions based on which branch you are currently in. After initializing the repo, you will be in the develop branch, so from here you would typically either start a new feature, release or hotfix branch.\nClicking Start Feature will let you define a name for the branch. GitFlow will add the feature branch prefix for you so don’t include that.\nHere I have created a feature branch called SingleSignOn:\nAs you can see, the extension will now suggest Finish Feature as the recommended action:\nNote that all other actions are still available from the Other menu.\nIn the GitFlow world, you are allowed to have multiple feature branches but only one release and hotfix branch at any single time. In fact, if you try to create multiple release branches, you will get an error.\nKeeping track of multiple feature branches can be cumbersome, so the extension lists all active feature branches is a separate section:\nAs you can see, if you hover over a feature will get some more details on it, and if you right-click on it you can (depending on the state), checkout, track or publish the feature branch. I will be looking at adding more functionality here in the future to make is even easier to use this workflow.\nI hope you will find this extension useful. Please report any bugs or feedback over at the GitHub site for this extenstion, over at https://github.com/jakobehn/GitFlow.VS\nComments Imported from the original WordPress site. Closed for new replies.\nJaime — 13 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#642956\nAwesome job Jakob!! :) is there any room for a \u0026ldquo;the making of\u0026hellip;\u0026rdquo; type article? It would be great to learn about how to write this type of VS extensions. :)\nJason W — 25 Mar 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#643588\nThis is a great value to our team. One idea for a feature request we had was to have an option before starting a release or a hotfix to show the most recent 2-3 tags in the repo. Since we are tagging by version per git flow and thereby naming the release/hotfix by the next version number, I still have to pull up source tree or the repo to get the last version of the specific project we used. This featurewould allows us to completely dump Source Tree :) Great job on such a clean extension!\nJakob Ehn — 25 Mar 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#643595\nThanks for the feedback Jason! I replied to your feature request on GitHub!\nM. Hashim — 06 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#644156\nwhen I click gitflow in team explorer it says no gitflow and suggests to install it, 2 windows flash fast one is powershell the other is command prompt, and nothing happens it still suggest to install gitflow, i went and installed gitflow manually and tested it on the command prompt and its working.\nDo you have any suggestions\nJakob Ehn — 06 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#644157\n@M. Hasim: that is strange. Can you check where you have Git installed? The extension tries to locate the git installation path by first checking the PATH variables, then the registry and the default to program files (x86)gitbin. In this path, the extension then installs the git-flow bash scripts a few dll:s that gitflow uses. Can you check if you have these files installed there?\nRob E — 13 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#644237\nAny chance there can be some integration with Work Items? Like I can right click a bug on the query results and start a new feature or hotfix or bug?\nJakob Ehn — 13 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#644253\n@rob: That\u0026rsquo;s a great idea! Would you mind posting a issue request at the GitHub site?\nVinod — 15 Oct 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#646657\nAs per Vincent Driessen post, a hotfix needs to branch out from master and it perfectly makes sense to do so, but the gitflow.vs has options to branch out a hotfix while in develop. Why did you have hotfix option in develop, what\u0026rsquo;s your thoughts?\nAlenka — 12 Nov 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/12/introducing-gitflow-for-visual-studio.aspx#647001\nI get a message \u0026ldquo;Could not locate Git for Windows on this machine. This is required by GitFlow. Please install it and try again.\u0026rdquo;\nBut I have it installed and it\u0026rsquo;s in the path variable.\nRaphael — 14 Jan 2016\nThe same here. Could you resolve it?\nTomer — 14 Dec 2015\n10x Jakob for this great extension!\nOne issue so far, I noticed that when starting a new feature (under VS online), it gets incorrect user name and date. Looks like it picked the guy who created the repo/branches.\njakob — 10 Jan 2016\nHi Tomer, this is standard Git behaviour. Until you have committed something, the branch points to the previous commit and the corresponding user. Thanks for using the extension!\nTomer — 14 Dec 2015\nI\u0026rsquo;ve noticed that the Feature branch Author name and Date are somehow taken as the last user pushed changes.\nRaghavan — 12 Jan 2016\nHello,\nSorry i am leaving a comment here since your book post does not allow me to comment. Does your latest Apress book cover Git on TFS ?\nThanks\njakob — 13 Jan 2016\nHi! It does not cover Git in any detail, it does talk about important practices around source control management when it comes to continuous delivery, such as branching patterns, branch policies and protecting your mainline. I don\u0026rsquo;t know of any good material on Git in TFS, there is of course a lot of material on Git.\nJeff Bowman — 01 Apr 2018\nIs your book for sale on Amazon? Do you have a link? Title?\nThanks,\nJeff Bowman\nFairbanks, Alaska\nMartinK — 21 Jan 2016\nHow do i Initialize / Confirm the settings are correct if the initialize button was never shown ?\nMy GIT was already working before installing GitFlow and it picked up SOME settings \u0026hellip; but when i start a feature it doesn\u0026rsquo;t end up in the correct \u0026ldquo;folder\u0026rdquo; \u0026hellip;\njakob — 24 Jan 2016\nIf your git repository was already configured for gitflow, the extension will pick this up. gitflow stores it settings in the config file, located in the .git directory of your repository. You can change your settings there\nSteven Lynn — 18 Feb 2016\nAny plans on adding support for the git flow support command?\nMartin Herløv Andersen — 28 Apr 2016\nLooks like a great add-in, thanks for making it.\nYou can also use SourceTree that also have great support for git flow, and more room to implement it on (-: Team explore is to cramp for my test.\nBut some people prefer to leave VS.\nSeetPync — 27 May 2016\nAfter I originally commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get four emails with the same comment. Is there any way you\u0026rsquo;ll be able to remove me from that service? Thanks! http://eurospinz24.ru\nGD — 03 Jun 2016\nIs there a way to initialize git flow to an existing git repository with the master/develop branches\nJakob Ehn — 17 Feb 2017\nYes, just open an existing repo and run the GitFlow extension. It will allow you to run Initialize\nKyriacos — 26 Oct 2016\nHi I have tried the add-in and have some questions around rebasing.\nWhen a conflict exists during a rebase:\nWill any support be added to redirect you to the merge conflicts screen directly to resolve them?\\ Will any support be added to display the \u0026ldquo;continue rebase\u0026rdquo; menu option when conflicts are resolved without running command line? Johnny Östman — 11 Oct 2017\nHi! I have a question about Pull Requests and GitFlow. Does it make sense to incorporate pull requests into the GitFlow plugin?\nExample 1) \u0026ldquo;Finish release\u0026rdquo; merges the \u0026ldquo;Release branch\u0026rdquo; into local master and origin/master if specified. But in this case the testing should have been done in the release branch, therefor no need of a pull request?\nExample 2) \u0026ldquo;Finish feature\u0026rdquo; merges the feature branch only to the local develop branch? In this case there will be no need for a pull request from the plugin? Or does the \u0026ldquo;Finish feature\u0026rdquo; also have the option to merge to origin/develop?\nSowokie — 02 Jul 2018\nJohnny did you ever find out? I want to use PR\u0026rsquo;s with GitFlow but am unsure if it works together.\nAugusto — 22 Feb 2018\nI got this: \u0026ldquo;Could not locate git for windows on this machine\u0026hellip;\u0026rdquo;\nArshad Mohammad — 21 Mar 2018\nThank you for this wonderful tool.\nDamir Šmigovec — 25 Mar 2018\nHello Jakob,\nYou did a great job. I see that you updated VS plugin with \u0026lsquo;Implemented support for feature finish \u0026ndash;squash and \u0026ndash;no-ff\u0026rsquo;\nat Oct 12, 2017, but latest version on marketplace is dated 1/3/2017, 8:40:07 PM.\nPlease, could you publish the latest version with squash feature to marketplace?\nThank you,\nDamir\nYaniv — 07 Nov 2018\nHey,\nI would like to ask the same question as Damir Šmigovec.\nWe would also like to use the feature finish –squash and –no-ff\nThanks,\nYaniv.\nJosé Salgueiro — 06 Jun 2019\nHi Jakobehn,\nGreat extension!\nI\u0026rsquo;m trying to make a code and I\u0026rsquo;m using visual studio 2019 and I keep getting the error «Visual studio did not load one or more extensions that were using deprecated APIs».\nI managed to update the manifest but I believe I need to put it to work asynchronous too.\nI can\u0026rsquo;t resolve this issue. Can you help?\nThanks\njakob — 13 Jun 2019\nThe visual studio 2019 version is available in the marketplace, and the update code is available at GitHub (it\u0026rsquo;s the master branch)\nThanks for using the extension!\n/Jakob\nTroy Gerton — 20 Feb 2020\nHi Jakob,\nI would very much like to roll out your extension to our team, but I\u0026rsquo;m getting the following error when trying to initialize gitflow…\nSystem.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified\nat System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)\nat System.Diagnostics.Process.Start()\nat GitFlow.VS.GitFlowWrapper.Init(GitFlowRepoSettings settings)\nat GitFlowVS.Extension.ViewModels.InitModel.OnInitialize()\nTroy Gerton — 20 Feb 2020\nHi again, Jakob,\nI was running the init from within the VS 2019 IDE. I ran git flow init -f from a command prompt and it ran as expected.\nTroy Gerton — 20 Feb 2020\nSorry, me again. Just tried creating a new feature branch using gitflow and errored out again\u0026hellip;\nSystem.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified\nat System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)\nat System.Diagnostics.Process.Start()\nat GitFlow.VS.GitFlowWrapper.RunGitFlow(String gitArguments, Int32 timeout)\nat GitFlow.VS.GitFlowWrapper.StartFeature(String featureName)\nat GitFlowVS.Extension.ViewModels.ActionViewModel.StartFeature()\njakob — 20 Feb 2020\nHi Troy,\nCan you share the exact version of Visual Studio 2019 and the version of the GitFlow extension that you are using?\nThanks\n/Jakob\nrick — 29 May 2021\nDamn, doesn\u0026rsquo;t work with 2019 Community edition. That\u0026rsquo;s too bad, love it (we use this at work).\nBrent — 14 Mar 2022\nJakob, I know this is several years later than your blog post, but hopefully, you are still checking in from time to time. I really like GitFlow and want to recommend it to my new team, but at what point in the process do code reviews happen? Before the feature branch is closed? After merging back to develop but before release? Any insight anyone has would be great. Thanks.\nAAAAA — 14 Jun 2022\nTRASH!!!!\nInstead of respecting the standard and merging an hotfix in main and develop, it merges hotfix in main, then main into develop, leading to a confusing, standard ignoring way of abusing gitflow.\nNO GOOD\nIvo Valente — 02 Jan 2026\nI just realized that the extension no longer appears in the Team Explorer in Visual Studio 2026, is there an update for VS2026 planned? Your effort would be very much appreciated, thankyou.\n","permalink":"https://blog.ehn.nu/2015/02/introducing-gitflow-for-visual-studio/","summary":"\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e: The exension is now also available for Visual Studio 2015 Preview: \u003ca href=\"https://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a\" title=\"https://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a\"\u003ehttps://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eGitFlow 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. \u003cbr\u003e\nGitFlow was introduced by \u003ca href=\"http://nvie.com/about/\"\u003eVincent Driessen\u003c/a\u003e in \u003ca href=\"http://nvie.com/posts/a-successful-git-branching-model/\"\u003ethis post\u003c/a\u003e 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 \u003cbr\u003e\nsense to implement tooling support for the workflow, which Vincent added shortly after. His repo is available at \u003ca href=\"https://github.com/nvie/gitflow\" title=\"https://github.com/nvie/gitflow\"\u003ehttps://github.com/nvie/gitflow\u003c/a\u003e, although it hasn’t been updated since 2012. \u003cbr\u003e\nHowever, several forks has been made, one of the most active is being developed by Peter van der Does at \u003ca href=\"https://github.com/petervanderdoes/gitflow\" title=\"https://github.com/petervanderdoes/gitflow\"\u003ehttps://github.com/petervanderdoes/gitflow\u003c/a\u003e\u003c/p\u003e","title":"Introducing GitFlow for Visual Studio"},{"content":"In my previous post, I showed how you can trigger a release in Visual Studio Release Management from a TeamCity build step.\nWhen Visual Studio Release Management 2013 RTM’ed, it came with customized TFS build templates that made it easy to trigger a release from a TFVC or Git build in TFS. These build templates relied on the ReleaseManagementBuild command line client, so it required the VSRM client being installed on the build server.\nThen, with the update train of Visual Studio 2013, new functionality such as vNext deployments, support for Powershell DSC etc was added. Together with this a new REST API was introduced that removes the need for a command line application to trigger a release. However, this REST API only works for vNext deployments, and it will most likely never be implemented for agent based deployments. Basically all new functionality in the release management area only works for vNext deployements, so you should be looking to move in that direction.\nAlso, in VS 2013 Update 4 support was added for connecting to the Release Management service running in Visual Studio Online. With this option, another way of triggering release was added, in which the Release Management service listens for build completion events in TFS which will kick off a release. It is still possible to use the API however, in cases where you don’t run TFS Build.\nSo, since this is rather confusing at the moment and causes a lot of questions, I decided to summarize the currently available combinations and the options that you have when it comes to triggering a release in VSRM:\nSource Release Management Deployment Type Options VSO Build VSO vNext Automatically (through build completed event) VSO Build VSO Agent-Based N/A TFS Build On-Premise (Update 3) vNext REST API TFS Build On-Premise (Update 3) Agent-Based ReleaseBuildTemplate 3rd party/share VSO vNext REST API 3rd party/share VSO Agent-Based N/A 3rd party/share On-Premise (Update 3) vNext REST API 3rd party/share On-Premise (Update 3) Agent-Based ReleaseManagementBuild.exe Note that some of these combinations are not supported at the moment, those are marked with N/A.\nHope that helps\nComments Imported from the original WordPress site. Closed for new replies.\nAhmed — 22 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/05/trigger-releases-in-visual-studio-release-management.aspx#644386\nWith RM update 4 it listens to builds completion, will he trigger release for each build or take the latest one ? the senario is we assume that a release takes time (provisioning configuring maybe even running acceptance tests) in the meanwhile checkins and builds were generated by tfs will, when RM finish the release will it take the latest one or it queues all of them ? and of course hopefully it always takes the latest one.\nJakob Ehn — 22 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/02/05/trigger-releases-in-visual-studio-release-management.aspx#644388\n@Ahmed: RM will trigger for every build completion event, which actually is a problem since if a new release starts before the current release has finished the new one will fail. So currently you need to make sure that you don\u0026rsquo;t trigger a new build before the current release has finished.\\\n","permalink":"https://blog.ehn.nu/2015/02/trigger-releases-in-visual-studio-release-management/","summary":"\u003cp\u003eIn my previous \u003ca href=\"http://geekswithblogs.net/jakob/archive/2015/01/14/trigger-visual-studio-release-management-vnext-from-teamcity.aspx\"\u003epost\u003c/a\u003e, I showed how you can trigger a release in Visual Studio Release Management from a TeamCity build step.\u003c/p\u003e\n\u003cp\u003eWhen Visual Studio Release Management 2013 RTM’ed, it came with customized TFS build templates that made it easy to trigger a release from a TFVC or Git build in TFS. These build templates relied on the ReleaseManagementBuild command line client, so it required the VSRM client being installed on the build server.\u003c/p\u003e","title":"Trigger Releases in Visual Studio Release Management"},{"content":"Currently, Microsoft is working hard on a complete rewrite of the TFS Build system. They announced this, among other things, at the Connect event back in November and did a short demo of it. It is not yet available, but as part of the MVP program, a few of us has now been fortunate enough to get access to an early preview of the new build system.\nNote: This version is in pre-alpha state, meaning that a lot of things can and will change until the final version!\nMicrosoft will enable a beta version to a broader public on Visual Studio Online later on this year, and it will RTM in TFS 2015. I will write a series of blog posts about Build vNext as it evolves. In this first post I will take a quick look at how to create and customize build definitions and running them in the new Web UI.\nKey Principals The key principals of TFS Build vNext are:\nCustomization should be dead simple. Users should not have to learn a new language (Windows Workflow anyone?) in order to just run some tool or script as part of the build process \\ Provide a simple Web UI for creating and customizing build definitions. No need for Visual Studio to customize builds anymore. \\ Support cross platform builds (Linux, MacOS…) As in most other areas right now, Microsoft is serious about supporting other platforms than Windows, and TFS Build won’t be an exception. \\ Sharing build infrastructure. The concept of a build controller tied to a collection is gone, instead we will create agent pools at the deployment level and connect agents to those. \\ Don’t mess with the build output and keep my logs clean. One of the most frustrating things about the current version of TFS Build is that by default it doesn’t preserve the output structure of the compiled projects, but instead places them beneath a common Binaries directory. This causes all sort of problems, such as post build events that are dependent on relative path etc. CI build == Dev build ! \\ Work side by side with the existing build system. All your existing XAML build definitions will continue to work just like before, and you will be able to create new ones. But don’t expect anything to be added in terms of functionality to the XAML builds Creating a build definition in vNext In this post, I will show how easy it is to create a new build definition in Build vNext, and customize it to update the version info in all the assembly files using a PowerShell task with a custom script.\nNote: There will probably be a versioning task out of the box in the final release, but currently there isn’t.\nLet’s get started:\nFrom the dropdown, you can select from a list of build definition templates. These templates are created by saving an existing build definition as a template. Currently, they are scoped to the team project level: Here I’m going to select the Visual Studio definition template. \\ This results in a build definition with two tasks, one that compiles the solution and one that runs all the unit tests using the Visual Studio test runner task \\ Selecting a task shows the properties of that task to the right, the properties of the Visual Studio Build task is shown above. Some of these properties are typed, meaning that for example the Solution property let’s you browse the current repository to select a solution. By default, it will locate all solution files and compile them (using the ***.sln pattern) You can also see that the Platform and the Configuration property uses the variables $(platform) and $(config). We will come back to them shortly. \\ The first thing we want to do typically is specifying which repository that the build will download the source from. To do this, select the Repository tab: Looking at the Repository type field, since this is a Git team project it will let me choose either Git (which means a git repo in the current team project) or GitHub, which actually lets me choose any Git repo. In that case I will need to enter credentials as well. When selecting the Git repo type, i can then select the repo (Visual Studio ALM in this case) from the current team project, and then I can select the default branch in a drop down. \\ If you want to add more tasks to the definition, go back to the Build tab and click on the Add new task link. This will display a list of all available tasks, shown below: The list of tasks here are of course not complete, but as you can see there are a lot of cross platform tasks there already. To add a task to the build definition, select it and press Add. Here, I will select the PowerShell task that I will use to version all my assemblies: When adding a new task it will end up at bottom of the task list, but you can easily reorder the tasks by using drag and drop. Since I must stamp the version information before i compile my solution, I have dragged the PowerShell task to the top. This task then requires me to select a PowerShell file to execute, and I also specified a working folder since the script I am using assumes this. All paths here are relative to the repository. Note: Although currently not possible, it will be possible to rename the build tasks \\ On the Triggers tab, the only option available right now is to trigger the build on every check-in (or push in the case of Git). I can also select to batch the changes, which is the same thing as the Rolling build trigger in the existing version of TFS build. This means that all changes that are checked in during a running build will be batched up and processed in the next build as soon as the current build has completed. In addition we can specify one or more branches that should trigger this build. Tip: The filter strings can include * as a filter, which lets me for example specify refs/heads/feature* as a filter that will trigger on any change on any branch that starts with the string feature. \\ On the Variables tab, we can specify and add new variables for this build definition. Here you can see the config and platform variables that were referenced in the Build tab: \\ Last, let’s take a look at the Options tab. The MultiConfiguration option enables us to build the selected solution(s) multiple times, each time for every combination of the variables that are specified here. By default, it will list the config and platform variables here. So, this means that the build will first build my solution using Debug | Any CPU, and the it will compile it using Release | Any CPU. If I check the Parallel checkbox, it will run these combinations in parallel, if there are multiple agents available of course. Also, we can enable copy to Staging and Drop location here. The build agent will copy everything that matches the Search pattern and place it in the staging folder \\ Finally, let’s save the new build definition. Note that you can also add a comment every time you save a build definition: These comments are visible on the History tab, where you can view the history of all the changes to the build definition and view the changes between any of the changes. Nice! Running a Build The build definition is complete, let’s kick off a build. Click on the Queue build.. button at the top to do this. This will show the live output of the build, both in a console output window and in an aggregated view where the status of each task is shown:\nHere you can note several nice features of build vNext:\nThe console output shoes the exact output from each task, just like it would if you ran the same command on your local machine \\ The aggregated view to the left shows the status and progress of every task which makes it very clear how far in the process the build is \\ This view also show parallel builds, in this case I have enabled the MultiConfiguration option and have two build agents configured, meaning that both Debug|AnyCPU and Release|AnyCPU are being processed in parallel on separate agents. \\ If you select one of the tasks to the left, you will see the build output for this particular task When the build completes, you will see a build summary and you can also view a timeline of the build where the duration of each task is shown:\nComments Imported from the original WordPress site. Closed for new replies.\nTom — 15 Jan 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#642557\nDoes it still require that Visual Studio be installed on the build machine?\nJakob Ehn — 18 Jan 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#642580\n@Tom: Probably, the build tools are not shipped with TFS Build and my guess is that that\u0026rsquo;s not going to change.\nMike — 19 Jan 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#642598\nI can\u0026rsquo;t even begin to tell you how excited I am about this. I love the direction that TFS has been headed. That being said, I felt like Team Build was a sub-par option for builds/deployments. Could you share a link to the video in which the news was shared about the rewrite of Team Build?\nJakob Ehn — 19 Jan 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#642599\n@Mike: I\u0026rsquo;m as excited as you are :-) The new was showed briefly during the Connect event. You can check it out here, it\u0026rsquo;s about 36 minutes into the video:\nhttp://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/015\\\ndaniel — 23 Jan 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#642658\n\u0026ldquo;All your existing XAML build definitions will continue to work just like before\u0026rdquo;\nDo you know if the TFS2010 build definitions will be still supported?\nJakob Ehn — 25 Jan 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#642681\n@Daniel: Yes, they will continue to work without any changes\nNatalia — 20 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#643063\nHei Jakob, do you know what are plans for version controling build definitions?\\\nJakob Ehn — 20 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#643066\n@Natalia: They will not be version controlled. They are however \u0026ldquo;versioned\u0026rdquo; in the sense that every change is audited and you can see the full history.\nKrati — 08 Apr 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#643760\nCan we use developer command prompt to queue builds in Build vNext? Or doing from the browser is the only option? Also, do you mean that the current build definitions we have in TFS2012 can be used as-is in Build vNext without any changes? There is no need to re-write definitions?\nJakob Ehn — 08 Apr 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#643761\n@Krati: There will be a possiblity to run the entire build process on you local machine, but the details around this have not yet been published.\nAnd yes, all your existing build definitions will work as is, this new build system will be running side-by-side with the existing one.\nKrati — 08 Apr 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#643763\nThanks Jakob. What I meant is, if I have to queue build using vNext, I\u0026rsquo;ll have to write a new definition as the existing ones can\u0026rsquo;t be migrated to work with vNext, right?\\\nJakob Ehn — 11 Apr 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#643827\n@Krati: Sorry, I think I don\u0026rsquo;t exactly understand your question. You won\u0026rsquo;t be able to automatically migrate the old XAML definitions to vNext ones. But you will be able to create, edit and queue XAML builds just like today. So if you have a lot of investments in XAML builds you don\u0026rsquo;t have to migrate them all at once, but rather do this over time\nJustin — 22 Apr 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#643967\nBeing able to run the entire build process on your local machine (with tweaks of course!) would be a big improvement, as you said CI build == Dev build! Currently there\u0026rsquo;s no way to add custom steps before/after the solution build without going outside VS.\nI also hope they include a trigger based on updates to NuGets that the sln depends on.\nMick Letofsky — 09 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#644678\nHi All,\nHas anyone attempted to build an SSIS package with the new Build.Preview functionality using the Visual Studio build option? Thanks!\nMick\nCliff Harker — 15 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#644785\nI got this for an SSIS package\u0026hellip;..The build server had SSDTBI and SSDT installed as well as VS2013U4\nProject \u0026ldquo;e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1.sln\u0026rdquo; on node 1 (default targets).\nValidateSolutionConfiguration:\nBuilding solution configuration \u0026ldquo;Development|Default\u0026rdquo;.\ne:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1osCodePoint1.dtproj.metaproj(0,0): Warning MSB4078: The project file \u0026ldquo;osCodePoint1osCodePoint1.dtproj\u0026rdquo; is not supported by MSBuild and cannot be built.\nProject \u0026ldquo;e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1.sln\u0026rdquo; (1) is building \u0026ldquo;e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1osCodePoint1.dtproj.metaproj\u0026rdquo; (2) on node 1 (default targets).\ne:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1osCodePoint1.dtproj.metaproj : warning MSB4078: The project file \u0026ldquo;osCodePoint1osCodePoint1.dtproj\u0026rdquo; is not supported by MSBuild and cannot be built.\nDone Building Project \u0026ldquo;e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1osCodePoint1.dtproj.metaproj\u0026rdquo; (default targets).\nDone Building Project \u0026ldquo;e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1.sln\u0026rdquo; (default targets).\nBuild succeeded.\n\u0026ldquo;e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1.sln\u0026rdquo; (default target) (1) -\u0026gt;\n\u0026ldquo;e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1osCodePoint1.dtproj.metaproj\u0026rdquo; (default target) (2) -\u0026gt;\n(Build target) -\u0026gt; e:TFS-Buildfc6fccd0SEUDataLoaderosCodePoint1osCodePoint1osCodePoint1.dtproj.metaproj : warning MSB4078: The project file \u0026ldquo;osCodePoint1osCodePoint1.dtproj\u0026rdquo; is not supported by MSBuild and cannot be built.\n1 Warning(s)\n0 Error(s)\nTime Elapsed 00:00:00.09\nJakob Ehn — 18 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#644828\n@Cliff: Yes, MSBuild still doesn\u0026rsquo;t support the BI projects (SSIS, SSRS etc), you will need to use Visual Studio to build them. But it should be easy enough to write a short PowerShell script that launches devenv.exe to compile the solution and then run it using the PowerShell task\nperreaultd — 26 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645005\nWhat\u0026rsquo;s really missing is to be able to interact with the build past the Staging and Dropping build dont you think?\nIt\u0026rsquo;s way easy to launch scripts during the build process but it doesn\u0026rsquo;t seem to be a way to launch scripts after the build is dropped in the DropFolder. For deployment for exemple.\nJust the way TfvcTemplate.12.2.xaml would allow with the Pre and PostDrop powershell scripts.\nHave you found a way to do so?\nJakob Ehn — 26 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645006\n@perreaultd: Actually, since I wrote this blog post the way drops are handles has changed. Now there is a separate build step for this called Publish Artifacts to Drop, where you can specify exactly what to drop and where (server of fileshare)\nTake a look at Visual Studio Online and you will see how this works\nJeff Raymond — 29 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645039\nAs you said, the build definition template is \u0026ldquo;currently\u0026rdquo; scoped to the team project. It forces us to place all our build definition in a single \u0026ldquo;build\u0026rdquo; project (with the template) since we cannot create a build definition based on a template that is located into another team project or at the collection level (I thought it would).\nFor example, I have around 30 Vb6 projects that I would like to build using VNext (migrating from old Nant on Win2000 machine\u0026hellip;). I\u0026rsquo;ve created a powershell template script in which I use the definition environment variables for the specifics of the project. I thought it could have been great that each vb6 project had its own tfs team project with its own build definition. But regarding the above, I don\u0026rsquo;t think its doable.\nAm I wrong ? Any ideas ?\nThanks :-)\nperreaultd — 29 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645054\n@Jakob Ehn: Thank you for this specification. I guess this approch (managing Drop as a build step) is going to be available with TFS On-Prem someday. Hope to be RTM!\nYou know where i could get this information? What\u0026rsquo;s going to be released into the RTM version vs. the update 1 version?\njrummell — 01 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645085\nThanks for sharing, Jakob! Any chance you could share your powershell script for updating AsseblyInfo?\nLuke — 09 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645216\n@JRummel: You can find an example here https://msdn.microsoft.com/Library/vs/alm/Build/scripts/index\\\nRathen — 12 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645257\nDo you guys have plans to add gated check-in trigger? We are really interested in that capability\nJakob Ehn — 18 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645339\n@Rathen: I think you need to direct that question to Microsoft :-)\nguidway — 07 Aug 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx#645700\nDoes the new TFS Build VNext Server have a dependency on the Window\u0026rsquo;s Service - Remote Access Connection Manager - like the previous versions of TFS did?\n","permalink":"https://blog.ehn.nu/2015/01/tfs-build-vnext-a-preview/","summary":"\u003cp\u003eCurrently, Microsoft is working hard on a complete rewrite of the TFS Build system. They announced this, among other things, at the Connect event back in November and did a short demo of it. It is not yet available, but as part of the MVP program, a few of us has now been fortunate enough to get access to an early preview of the new build system.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eNote: This version is in pre-alpha state, meaning that a lot of things can and will change until the final version!\u003c/strong\u003e\u003c/p\u003e","title":"TFS Build vNext – A Preview"},{"content":"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.\nAlso 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.\nThis REST API opens up a lot of integration possibilities, for example we don’t have to use TFS Build to automatically trigger a release. In this post, I will show how we can use the popular TeamCity build server from JetBrains to trigger a release as part of the build.\nFirst of all, we need to setup a release template in Visual Studio Release Management. I won’t go through all the details here, the most important once is that the components that we define must use the UNC Path as the source parameter:\nHere I have specified a shared folder, \\localhostbuildoutput. Beneath this path, VSRM will look for a folder that typically correspond to a build number that we will pass in using the API, as you will see later on.\nNext, we create our release template. To be able to trigger a build using the API, make sure that you tick the “Can trigger a release from a Build?” checkbox:\nThen we define our deployment sequence, in this case I just have one action for deploying my web site using a PowerShell script:\nThere is nothing really nothing special here, I refere to the DeployWebSite.ps1 which is a PowerShell DSC script that installs my web site. I have also a DestinationPath variable that is referenced in the DSC script and specifies where the web site should be installed on the server.\nNow, to trigger a release of this release template we are going to use a PowerShell script, that we can execute using TeamCity. I have used a sample from Microsoft and modified it to use parameters.\nHere is the full script:\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ param( [string]$rmServer, [string]$rmUser, [string]$rmPassword, [string]$rmDomain, [string]$releaseDefinition, [string]$deploymentPropertyBag ) $deploymentPropertyBag = $propertyBag = [System.Uri]::EscapeDataString($deploymentPropertyBag) $exitCode = 0 trap { $e = $error[0].Exception $e.Message $e.StackTrace if ($exitCode -eq 0) { $exitCode = 1 } } $scriptName = $MyInvocation.MyCommand.Name $scriptPath = Split-Path -Parent (Get-Variable MyInvocation -Scope Script).Value.MyCommand.Path Push-Location $scriptPath $orchestratorService = \u0026#34;http://$rmServer/account/releaseManagementService/_apis/releaseManagement/OrchestratorService\u0026#34; $status = @{ \u0026#34;2\u0026#34; = \u0026#34;InProgress\u0026#34;; \u0026#34;3\u0026#34; = \u0026#34;Released\u0026#34;; \u0026#34;4\u0026#34; = \u0026#34;Stopped\u0026#34;; \u0026#34;5\u0026#34; = \u0026#34;Rejected\u0026#34;; \u0026#34;6\u0026#34; = \u0026#34;Abandoned\u0026#34;; } #For Update3 use api-version=2.0 for Update4 use api-version=3.0. $uri = \u0026#34;$orchestratorService/InitiateRelease?releaseTemplateName=\u0026#34; + $releaseDefinition + \u0026#34;\u0026amp;deploymentPropertyBag=\u0026#34; + $propertyBag + \u0026#34;\u0026amp;api-version=3.0\u0026#34; $wc = New-Object System.Net.WebClient #$wc.UseDefaultCredentials = $true # rmuser should be part rm users list and he should have permission to trigger the release. $wc.Credentials = new-object System.Net.NetworkCredential(\u0026#34;$rmUser\u0026#34;, \u0026#34;$rmPassword\u0026#34;, \u0026#34;$rmDomain\u0026#34;) try { $releaseId = $wc.UploadString($uri,\u0026#34;\u0026#34;) $url = \u0026#34;$orchestratorService/ReleaseStatus?releaseId=$releaseId\u0026#34; $releaseStatus = $wc.DownloadString($url) Write-Host -NoNewline \u0026#34;`nReleasing ...\u0026#34; while($status[$releaseStatus] -eq \u0026#34;InProgress\u0026#34;) { Start-Sleep -s 5 $releaseStatus = $wc.DownloadString($url) Write-Host -NoNewline \u0026#34;.\u0026#34; } \u0026#34; done.`n`nRelease completed with {0} status.\u0026#34; -f $status[$releaseStatus] } catch [System.Exception] { if ($exitCode -eq 0) { $exitCode = 1 } Write-Host \u0026#34;`n$_`n\u0026#34; -ForegroundColor Red } if ($exitCode -eq 0) { \u0026#34;`nThe script completed successfully.`n\u0026#34; } else { $err = \u0026#34;Exiting with error: \u0026#34; + $exitCode + \u0026#34;`n\u0026#34; Write-Host $err -ForegroundColor Red } Pop-Location exit $exitCode Basically, this script calls the following REST API endpoint:\nhttp://RMSERVER/account/releaseManagementService/_apis/releaseManagement/OrchestratorService/InitiateRelease?releaseTemplateName=RELEASEDEFINITION\u0026amp;deploymentPropertyBag=PROPERTYBAG\u0026amp;api-version=3.0\nThis REST endpoint returns a release id, which we can use to read the status of the release. The script loops until the status is not “In Progress” and the quits and returns an exit code depending on how the release went.\nThe parameters of the above endpoint are:\nRMSERVER The URL including port to the release management server, typically somthing like contoso.com:1000 \\ RELEASEDEFINITION The name of the release template that we want to trigger. PROPERTYBAG Now this one is a bit special. This is an array of key/value which is not yet documented but it typically looks like this: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ { \u0026#34;Component1:Build\u0026#34; : \u0026#34;Component1Build_20140814.1\u0026#34;, \u0026#34;Component2:Build\u0026#34; : \u0026#34;Component2Build_20140815.1\u0026#34;, \u0026#34;ReleaseName\u0026#34; : \u0026#34;$releaseName\u0026#34; } The first two lines references two different components in RM. Here I have just called them Component1 and Component2. The :Build is a keyword and must be there. The value part is the build number, which RM will append to the UNC path that we defined earlier. Note that we can use different build numbers per component here if we want to. The last line is a predefined keyword that allows us to specify the name of the release, something that we actually can’t do using the RM client or the standard RM TFS Build release template so this is a nice feature.\nSo, to execute this script in TeamCity, add the above script to repository and then add a PowerShell build step at the end of your build in TeamCity that looks something like this:\nThe Script Arguments property is the tricky part, since we have to escape the quotes for the propertyBag parameter, and we will also use the %env:BUILD_NUMBER% variable from TeamCity for the build number. Here is the full string as an example: -rmServer SERVER:1000 -rmUser USER -rmPassword PASSWORD -rmDomain DOMAIN -releaseDefinition VSGallery -deploymentPropertyBag \u0026ldquo;{\u0026ldquo;VSGallery Web Application:Build\u0026rdquo; : \u0026ldquo;%env.BUILD_NUMBER%\u0026rdquo;,\u0026ldquo;ReleaseName\u0026rdquo; : \u0026ldquo;%env.BUILD_NUMBER%\u0026rdquo;}\u0026rdquo;\nRunning this build in TeamCity will now trigger a release in Release Management:\nComments Imported from the original WordPress site. Closed for new replies.\nDaniel Carlstedt — 17 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/14/trigger-visual-studio-release-management-vnext-from-teamcity.aspx#643000\nGreat Post. I would love to use these REST API\u0026rsquo;s to initiate my vNext release but can\u0026rsquo;t seem to find any documentation on them. Do you happen to know if/where the documentation is located?\nadwait pathak — 17 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/14/trigger-visual-studio-release-management-vnext-from-teamcity.aspx#643005\nHi, i get error : 500, internal server error.\ncan you please give some example how do you pass arguments:\neg -rmServer ServerName - rmUser domainusername -rmpassword Password -releaseDefinition vNextTemplateName\nJakob Ehn — 17 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/14/trigger-visual-studio-release-management-vnext-from-teamcity.aspx#643006\n@Daniel: Unfortunately at the moment the API is not documented at all. Eventually they will appear here:\nhttp://www.visualstudio.com/en-us/integrate/api/overview\\\nJakob Ehn — 17 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/14/trigger-visual-studio-release-management-vnext-from-teamcity.aspx#643007\n@adwait: There is an example in the post above:\n-rmServer SERVER:1000 -rmUser USER -rmPassword PASSWORD -rmDomain DOMAIN -releaseDefinition VSGallery -deploymentPropertyBag \u0026ldquo;{\u0026ldquo;VSGallery Web Application:Build\u0026rdquo; : \u0026ldquo;%env.BUILD_NUMBER%\u0026rdquo;,\u0026ldquo;ReleaseName\u0026rdquo; : \u0026ldquo;%env.BUILD_NUMBER%\u0026rdquo;}\u0026rdquo;\nMake sure that you have the quotes correct\nSimon Reindl — 01 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2015/01/14/trigger-visual-studio-release-management-vnext-from-teamcity.aspx#645089\nThanks Jakob, the API documentation is now opened up.\nGreat example.\n","permalink":"https://blog.ehn.nu/2015/01/trigger-visual-studio-release-management-vnext-from-teamcity/","summary":"\u003cp\u003eThe 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.\u003c/p\u003e\n\u003cp\u003eAlso 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.\u003c/p\u003e","title":"Trigger Visual Studio Release Management vNext from TeamCity"},{"content":"Getting started with Application Insights (AI) in a new or existing application is very easy. From Visual Studio 2013 Update 3 it is even integrated right into the New Web Project dialog:\nWhen you select this option, Visual Studio will automatically create a new instrumentation key for you that identifies the web application, and insert the necessary Javascript into your master layout page that takes care of sending usage information to Application Insights. Try running your application, click around a few times, and you will see information showing up in the Azure portal within, literally, a few seconds.\nNB: you can also perform this operation later on, by select XXXX from the context menu in Solution Explorer.\nThis will give you a lot of information such as page views, response times, user information like browser version and geographic location. If you want to add custom tracing, you can do this using the Application Insights Telemtry SDK It exists both for .NET code and JavaScript, so you can add tracing both on the backend and the frontend.\nNow, this is very nice for a new project but what if you have an existing application that already contains a lot of code for writing trace and debug information? Perhaps you are using Log4Net or the TraceListener class to emit diagnostic information in some way. Well, the good news is that the nice fellows over at Microsoft thought about this. They have created a set of public NuGet packages that makes it very easy to forward the information that you are logging to Application Insights. This means that you won’t have to rewrite any of the existing code and still have the tracing information show up in the portal.\nFor example, if you are using Log4Net you can use the Microsoft.ApplicationInsights.Log4NetAppender package that will send the information you log using the Log4Net API to AI. It is implemented as a standard Log4Net Appender class, which makes it very easy to use. Just add the package to the projects that performs logging, and the following information will be added to your configuration file:\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ \u0026lt;log4net\u0026gt; \u0026lt;root\u0026gt; \u0026lt;level value=\u0026#34;ALL\u0026#34;/\u0026gt; \u0026lt;appender-ref ref=\u0026#34;aiAppender\u0026#34;/\u0026gt; \u0026lt;/root\u0026gt; \u0026lt;appender name=\u0026#34;aiAppender\u0026#34; type=\u0026#34;Microsoft.ApplicationInsights.Log4NetAppender.ApplicationInsightsAppender, Microsoft.ApplicationInsights.Log4NetAppender\u0026#34;\u0026gt; \u0026lt;layout type=\u0026#34;log4net.Layout.PatternLayout\u0026#34;\u0026gt; \u0026lt;conversionPattern value=\u0026#34;%message%newline\u0026#34;/\u0026gt; \u0026lt;/layout\u0026gt; \u0026lt;/appender\u0026gt; \u0026lt;/log4net\u0026gt; Now, you existing logging Log4Net code..\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ log4net.Config.XmlConfigurator.Configure(); var logger = log4net.LogManager.GetLogger(this.GetType()); logger.Info(\u0026#34;Some information message\u0026#34;); logger.Warn(\u0026#34;A warning message\u0026#34;); logger.Error(\u0026#34;An error message\u0026#34;); Will end up as Trace information in the Azure Portal;\nSince this is a regular log4net appender, you can apply the standard filters, to include or exclude certain types of information.\nMicrosoft has also implemented NuGet packages for NLog and also a TraceListener class, for use when you do standard .NET tracing. In addition, there are some 3rd party packages that covers other logging frameworks such as Serilog:\nHappy logging!\nComments Imported from the original WordPress site. Closed for new replies.\nPhilip Hendry — 07 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/11/09/using-log4net-for-application-insights.aspx#644171\nI\u0026rsquo;ve been trying to redirect my log4net to Application Insights but just don\u0026rsquo;t seem to be getting the trace through in much the same way as others with the same problem.\n\\\nSo I\u0026rsquo;ve tried to create a canonical example using an ASP.NET MVC template in VS2013 Update 4. Nothing special, just ticked the box to wire in Application Insights, added NuGet package for the Log4Net appender then added the configuration for the appender to web.config and code to the default controller action both taken from above.\n\\\nI see my requests appearing in the Application Insights portal now - one request and another for the Page View which was logged from the layout page. There is a distinct lack of any Trace information :(\n\\\nDo you have any hints as to why the trace isn\u0026rsquo;t getting through?\nPhilip Hendry — 07 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/11/09/using-log4net-for-application-insights.aspx#644172\nIgnore my last comment :)\nI\u0026rsquo;ve discovered that installing the PreRelease NuGet package for the log4net appender made everything work as expected!!\nashish — 20 May 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/11/09/using-log4net-for-application-insights.aspx#644343\nis there anything we must put in \u0026ldquo;configSections\u0026rdquo;\nI\u0026rsquo;m using log4net \u0026ldquo;Microsoft.ApplicationInsights.Log4NetAppender 0.7.0\n\u0026quot; nuget but appender does not found error I got and its not working :( , any inputs?\nTom — 20 Oct 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/11/09/using-log4net-for-application-insights.aspx#646709\nI just installed Microsoft.ApplicationInsights.Log4NetAppender on my windows console project so I can log log4net logs to ApplicationInsights. I cannot find an instruction on how I can specify the instrumentation key that I want to use with ApplicationInsights. Does anyone know how?\nI looked at http://jan-v.nl/post/using-application-insights-in-your-log4net-application but it does not seem to help.\nI also tried the following code to set the instrumentation key via code, but it does not seem to help either. private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);\nstatic void Main(string[] args)\n{ var appenders = log.Logger.Repository.GetAppenders();\nforeach(var appender in appenders)\n{\nif(appender.Name == \u0026ldquo;aiAppender\u0026rdquo;)\n{\nApplicationInsightsAppender appInsightAppender = (ApplicationInsightsAppender)appender;\nappInsightAppender.InstrumentationKey = \u0026ldquo;xxxxxx\u0026rdquo;;\n}\n}\nlog.Error(\u0026ldquo;logging something \u0026ldquo;);\n}\n}\nPushkar — 23 Sep 2017\nIs there any way to Integrate Application Insight into Azure Service Fabric?\nRich — 20 Jan 2020\nIn the case of web projects, to be able to specify your Instrumentation Key you should also install the Microsoft.ApplicationInsights.Web package from Nuget and it will create a ApplicationInsights.config file.\nWithin this config file, you add xxx at the top (under\nNingu Walikat — 27 Sep 2024\nThank you so much, it helped a lot.\n","permalink":"https://blog.ehn.nu/2014/11/using-log4net-for-application-insights/","summary":"\u003cp\u003eGetting started with Application Insights (AI) in a new or existing application is very easy. From Visual Studio 2013 Update 3 it is even integrated right into the New Web Project dialog:\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://gwb.blob.core.windows.net/jakob/WindowsLiveWriter/UsingLog4NetforApplicationInsights_3E6B/image_6.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2014/11/using-log4net-for-application-insights/6_image_thumb_2.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eWhen you select this option, Visual Studio will automatically create a new instrumentation key for you that identifies the web application, and insert the necessary Javascript into your master layout page that takes care of sending usage information to Application Insights. Try running your application, click around a few times, and you will see information showing up in the Azure portal within, literally, a few seconds.\u003c/p\u003e","title":"Using Log4Net for Application Insights"},{"content":"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.\nFellow ALM MVP Martin Hinshelwood has blogged about this several times, as well as other people 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.\nConsolidating multiple team projects into one is not that easy unfortunately, it involves migrating source code, work items, reports etc. Another thing that also need to be migrated is build definitions. It is possible to clone build definitions within the same team project using the TFS power tools.\nThe Community TFS Build Manager also lets you clone build definitions to other team projects. But there is no tool that allows you to clone/copy a build definition to another collection. So, I whipped up a simple console application that let you do this.\nThe tool can be downloaded from\nhttps://onedrive.live.com/redir?resid=EE034C9F620CD58D!8162\u0026amp;authkey=!ACTr56v1QVowzuE\u0026amp;ithint=file%2c.zip\nUsing CopyTFSBuildDefinitions You use the tool like this:\nCopyTFSBuildDefinitions SourceCollectionUrl SourceTeamProject BuildDefinitionName DestinationCollectionUrl DestinationTeamProject [NewDefinitionName]\nArguments\nSourceCollectionUrl The URL to the TFS collection that contains the team project with the build definition that you want to copy \\ SourceTeamProject The name of the team project that contains the build definition \\ BuildDefinitionName Name of the build definition \\ DestinationCollectionUrl The URL to the TFS collection that contains the team project that you want to copy your build definition to \\ DestinationTeamProject The name of the team project in the destination collection \\ NewDefinitionName (Optional) Use this to override the name of the new build definition. If you don’t specify this, the name will the same as the original one Example:\nCopyTFSBuildDefinitions https://jakob.visualstudio.com DemoProject WebApplication.CI https://anotheraccount.visualstudio.com\nNotes Since we are (potentially) create a build definition in a new collection, there is no guarantee that the various paths that are defined in the build definition exist in the new collection. For example, a build definition refers to server paths in TFVC or repos + branches in TFGit. It also refers to build controllers that definitely don’t exist in the new collection. So there will be some cleanup to do after you copy your build definitions. You can fix some of these using the Community TFS Build Manager, for example it is very easy to apply the correct build controller to a set of build definitions\nThe problem stated above also applies to build process templates. However, the tool tries to find a build process template in the new team project with the same file name as the one that existed in the old team project. If it finds one, it will be used for the new build definition. Otherwise is will use the default build template\nIf you want to run the tool for many build definitions, you can use this SQL scripts, compliments of Mr. Scrum/ALM MVP Richard Hundhausen to generate the necessary commands: \\\nUSE Tfs_Collection\nGO\nSELECT \u0026lsquo;CopyTFSBuildDefinitions.exe http://SERVER:8080/tfs/collection \u0026ldquo;\u0026rsquo; + P.ProjectName + \u0026lsquo;\u0026rdquo; \u0026ldquo;\u0026rsquo; + REPLACE(BD.DefinitionName,\u0026rsquo;\u0026rsquo;,\u0026rsquo;\u0026rsquo;) + \u0026lsquo;\u0026rdquo; http://NEWSERVER:8080/tfs/COLLECTION TEAMPROJECT\u0026rsquo;\nFROM tbl_Project P\nINNER JOIN tbl_BuildGroup BG on BG.TeamProject = P.ProjectUri\nINNER JOIN tbl_BuildDefinition BD on BD.GroupId = BG.GroupId\nORDER BY P.ProjectName, BD.DefinitionName\nHope that helps, let me know if you have any problems with the tool or if you find it useful\nComments Imported from the original WordPress site. Closed for new replies.\nMrHinsh — 06 Jun 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/06/05/copy-tfs-build-definitions-between-projects-and-collections.aspx#638219\nWhen are you going to integrate this into the TFS Integration Tools as a new adapter type. Could be really useful in there 😊\nJakob Ehn — 06 Jun 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/06/05/copy-tfs-build-definitions-between-projects-and-collections.aspx#638220\nWhen the integration tools is open source Martin :-)\nMia — 28 Jun 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/06/05/copy-tfs-build-definitions-between-projects-and-collections.aspx#638579\nHello Jakob, there is actually a tool which does this. It is commerical, but you can use it 30 days for free.\nhttp://visualstudiogallery.msdn.microsoft.com/ec36f618-d122-48a3-8236-7d9cd19791ee\nMia\\\niladan — 08 Aug 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/06/05/copy-tfs-build-definitions-between-projects-and-collections.aspx#639390\nAs i know, TFS integration tool is a free tool and have certain issues.\nWhat are other alternatives if any?\nJakob Ehn — 18 Nov 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/06/05/copy-tfs-build-definitions-between-projects-and-collections.aspx#641461\n@iladan: Opshub has a commercial system that supports work item migration/synchronization\nIqstr — 27 Jul 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/06/05/copy-tfs-build-definitions-between-projects-and-collections.aspx#645502\nawesome tools. it saved me hours\u0026hellip;\nAshish — 13 Nov 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/06/05/copy-tfs-build-definitions-between-projects-and-collections.aspx#647022\nIs the perfect tool I was looking for. Can you recompile for VS2015 too?\n","permalink":"https://blog.ehn.nu/2014/06/copy-tfs-build-definitions-between-projects-and-collections/","summary":"\u003cp\u003eThe 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.\u003c/p\u003e\n\u003cp\u003eFellow ALM MVP Martin Hinshelwood has blogged about \u003ca href=\"http://nakedalm.com/one-team-project/\"\u003ethis several times\u003c/a\u003e, as well as other \u003ca href=\"http://geekswithblogs.net/Optikal/archive/2013/09/05/153944.aspx\"\u003epeople\u003c/a\u003e 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.\u003c/p\u003e","title":"Copy TFS Build Definitions between Projects and Collections"},{"content":"Problem One of our customers recently had a problem with NuGet restore when they created a new build template, based on the standard TfvcTemplate.12.xaml template. In TFS 2013, package restore is done automatically by the default build templates.\nIt is configured as part of the RunMSBuild activity, where you can enable and disable this by setting the EnableNuGetPackageRestore property:\nHowever, when we were executing the builds we got the following warning in the build log:\nUnable to restore NuGet packages. Details: NuGet.exe was not found in the expected location: C:UsersBuildAppDataLocalTempBuildAgent18Assembliesnuget.exe\nThis error puzzled us quite a bit. NuGet.exe is installed as part of TFS Build and is located in the %ProgramFiles%/Microsoft Team Foundation Server 12.0/Tools folder. Why was Team Build looking in the build agent custom assembly folder?\nIt turns out that the reason for this was that the customer had not only checked in the custom activity assemblies in TFVC, they had also checked in all the references TFS assemblies (such as Microsoft.TeamFoundation.Build.Workflow.dll for example). This is not necessary, but had until now never caused any problems. But now, since this assembly was used during the build, it looked in the current path of the assembly for NuGet.exe which resolved to the path from the error message above.\nSolution After removing all the TFS assemblies from version control NuGet package restore started working again.\n","permalink":"https://blog.ehn.nu/2014/05/tfs-build-nuget-exe-was-not-found-in-the-expected-location/","summary":"\u003ch2 id=\"problem\"\u003eProblem\u003c/h2\u003e\n\u003cp\u003eOne of our customers recently had a problem with NuGet restore when they created a new build template, based on the standard TfvcTemplate.12.xaml template. In TFS 2013, package restore is done automatically by the default build templates.\u003c/p\u003e\n\u003cp\u003eIt is configured as part of the \u003ca href=\"http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.build.activities.runmsbuild.aspx\"\u003eRunMSBuild\u003c/a\u003e activity, where you can enable and disable this by setting the EnableNuGetPackageRestore property:\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://gwb.blob.core.windows.net/jakob/Windows-Live-Writer/b214d0212153_11F87/image_2.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2014/05/tfs-build-nuget-exe-was-not-found-in-the-expected-location/13_image_thumb.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eHowever, when we were executing the builds we got the following warning in the build log:\u003c/p\u003e","title":"TFS Build: NuGet.exe was not found in the expected location"},{"content":"Almost four years ago I wrote a post 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 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.\nSo, in this post I will show an updated version of the code for creating a build defintion. I will actually show two samples, one for the GitTemplate.12.xaml and one for the TfvcTemplate.xaml which are the default template used in TFS 2013.\nCreating a Git Build definition (GitTemplate.12.xaml) Here is the code for creating a build definition using the GitTemplate.12.xaml build process template //Create build definition and give it a name and desription IBuildDefinition buildDef = buildServer.CreateBuildDefinition(tp); buildDef.Name = \u0026#34;ATestBuild\u0026#34;; buildDef.Description = \u0026#34;A description for this build defintion\u0026#34;; buildDef.ContinuousIntegrationType = ContinuousIntegrationType.Individual; //CI //Controller and default build process template buildDef.BuildController = buildServer.GetBuildController(\u0026#34;Hosted Build Controller\u0026#34;); var defaultTemplate = buildServer.QueryProcessTemplates(tp).First(p =\u0026gt; p.TemplateType == ProcessTemplateType.Default); buildDef.Process = defaultTemplate; //Drop location buildDef.DefaultDropLocation = \u0026#34;#/\u0026#34;; //set to server drop //Source Settings var provider = buildDef.CreateInitialSourceProvider(\u0026#34;TFGIT\u0026#34;); provider.Fields[\u0026#34;RepositoryName\u0026#34;] = \u0026#34;Git\u0026#34;; provider.Fields[\u0026#34;DefaultBranch\u0026#34;] = \u0026#34;refs/heads/master\u0026#34;; provider.Fields[\u0026#34;CIBranches\u0026#34;] = \u0026#34;refs/heads/master\u0026#34;; provider.Fields[\u0026#34;RepositoryUrl\u0026#34;] = url + \u0026#34;/_git/Git\u0026#34;; buildDef.SetSourceProvider(provider); //Process params var process = WorkflowHelpers.DeserializeProcessParameters(buildDef.ProcessParameters); //What to build process.Add(\u0026#34;ProjectsToBuild\u0026#34;, new[]{\u0026#34;Test.sln\u0026#34;}); process.Add(\u0026#34;ConfigurationsToBuild\u0026#34;, new[]{\u0026#34;Mixed Platforms|Debug\u0026#34;}); //Advanced build settings var buildParams = new Dictionary\u0026lt;string, string\u0026gt;(); buildParams.Add(\u0026#34;PreActionScriptPath\u0026#34;, \u0026#34;/prebuild.ps1\u0026#34;); buildParams.Add(\u0026#34;PostActionScriptPath\u0026#34;, \u0026#34;/postbuild.ps1\u0026#34;); var param = new BuildParameter(buildParams); process.Add(\u0026#34;AdvancedBuildSettings\u0026#34;, param); //test settings var testParams = new Dictionary\u0026lt;string, object\u0026gt; { { \u0026#34;AssemblyFileSpec\u0026#34;, \u0026#34;*.exe\u0026#34; }, { \u0026#34;HasRunSettingsFile\u0026#34;, true }, { \u0026#34;ExecutionPlatform\u0026#34;, \u0026#34;X86\u0026#34; }, { \u0026#34;FailBuildOnFailure\u0026#34;, true }, { \u0026#34;RunName\u0026#34;, \u0026#34;MyTestRunName\u0026#34; }, { \u0026#34;HasTestCaseFilter\u0026#34;, false }, { \u0026#34;TestCaseFilter\u0026#34;, null } }; var runSettingsForTestRun = new Dictionary\u0026lt;string, object\u0026gt; { { \u0026#34;HasRunSettingsFile\u0026#34;, true }, { \u0026#34;ServerRunSettingsFile\u0026#34;, \u0026#34;\u0026#34; }, { \u0026#34;TypeRunSettings\u0026#34;, \u0026#34;CodeCoverageEnabled\u0026#34; } }; testParams.Add(\u0026#34;RunSettingsForTestRun\u0026#34;, runSettingsForTestRun); process.Add(\u0026#34;AutomatedTests\u0026#34;, new[]{ new BuildParameter(testParams)}); //Symbol settings process.Add(\u0026#34;SymbolStorePath\u0026#34;, @\u0026#34;\\serversymbolssomepath\u0026#34;); buildDef.ProcessParameters = WorkflowHelpers.SerializeProcessParameters(process); //Retention policy buildDef.RetentionPolicyList.Clear(); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Succeeded, 10, DeleteOptions.All); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Failed, 10, DeleteOptions.All); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Stopped, 1, DeleteOptions.All); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.PartiallySucceeded, 10, DeleteOptions.All); //Lets save it buildDef.Save(); Some things to note here:\nThe IBuildDefinitionSourceProvider interface is new in TFS 2013, and the reason for it is of course to abstract the differences between TFVC and Git source control. As you can see, we use the “TFGIT” to select the correct provider, and then we use the Fields property to populate it with information The process parameters are created by using dictionaires, with the corresponding key and values. If you are familiar with the GitTemplate.12.xaml, you will recognize the name of these parameters. As for drop locations, in TFS 2013 you can select between no drop location, a drop folder (share) or a server drop, which means the output is stored inside TFS and accessible from the web access. In the sample above, we specify #/ which (not that obvious) means a server drop. If you want to use a share drop location, just specify the server path for the DefaultDropLocation Creating a TFVC Build definition (TfvcTemplate.12.xaml) AS it turns out, creating a TFVC build definition using the TfvcTemplate.12.xaml is almost identical, since the build team went to great effort and abstracted away most differences. The only difference in fact, at least when it comes to the most common settings is how you define the workspace mappings. And this code is the same as it was in TFS 2010/2012. In addition, you don’t need to create a source provider, because there is nothing that needs to be configured other than the workspace.\nHere is the full sample for TFVC:\n//Create build definition and give it a name and desription IBuildDefinition buildDef = buildServer.CreateBuildDefinition(tp); buildDef.Name = \u0026#34;ATestBuild\u0026#34;; buildDef.Description = \u0026#34;A description for this build defintion\u0026#34;; buildDef.ContinuousIntegrationType = ContinuousIntegrationType.Individual; //CI //Controller and default build process template buildDef.BuildController = buildServer.GetBuildController(\u0026#34;Hosted Build Controller\u0026#34;); var defaultTemplate = buildServer.QueryProcessTemplates(tp).First(p =\u0026gt; p.TemplateType == ProcessTemplateType.Default); buildDef.Process = defaultTemplate; //Drop location buildDef.DefaultDropLocation = \u0026#34;#/\u0026#34;; //set to server drop //Source Settings buildDef.Workspace.AddMapping(\u0026#34;$/Path/project.sln\u0026#34;, \u0026#34;$(SourceDir)\u0026#34;, WorkspaceMappingType.Map); buildDef.Workspace.AddMapping(\u0026#34;$/OtherPath/\u0026#34;, \u0026#34;\u0026#34;, WorkspaceMappingType.Cloak); //Process params var process = WorkflowHelpers.DeserializeProcessParameters(buildDef.ProcessParameters); //What to build process.Add(\u0026#34;ProjectsToBuild\u0026#34;, new[]{\u0026#34;Test.sln\u0026#34;}); process.Add(\u0026#34;ConfigurationsToBuild\u0026#34;, new[]{\u0026#34;Mixed Platforms|Debug\u0026#34;}); //Advanced build settings var buildParams = new Dictionary\u0026lt;string, string\u0026gt;(); buildParams.Add(\u0026#34;PreActionScriptPath\u0026#34;, \u0026#34;/prebuild.ps1\u0026#34;); buildParams.Add(\u0026#34;PostActionScriptPath\u0026#34;, \u0026#34;/postbuild.ps1\u0026#34;); var param = new BuildParameter(buildParams); process.Add(\u0026#34;AdvancedBuildSettings\u0026#34;, param); //test settings var testParams = new Dictionary\u0026lt;string, object\u0026gt; { { \u0026#34;AssemblyFileSpec\u0026#34;, \u0026#34;*.exe\u0026#34; }, { \u0026#34;HasRunSettingsFile\u0026#34;, true }, { \u0026#34;ExecutionPlatform\u0026#34;, \u0026#34;X86\u0026#34; }, { \u0026#34;FailBuildOnFailure\u0026#34;, true }, { \u0026#34;RunName\u0026#34;, \u0026#34;MyTestRunName\u0026#34; }, { \u0026#34;HasTestCaseFilter\u0026#34;, false }, { \u0026#34;TestCaseFilter\u0026#34;, null } }; var runSettingsForTestRun = new Dictionary\u0026lt;string, object\u0026gt; { { \u0026#34;HasRunSettingsFile\u0026#34;, true }, { \u0026#34;ServerRunSettingsFile\u0026#34;, \u0026#34;\u0026#34; }, { \u0026#34;TypeRunSettings\u0026#34;, \u0026#34;CodeCoverageEnabled\u0026#34; } }; testParams.Add(\u0026#34;RunSettingsForTestRun\u0026#34;, runSettingsForTestRun); process.Add(\u0026#34;AutomatedTests\u0026#34;, new[]{ new BuildParameter(testParams)}); //Symbol settings process.Add(\u0026#34;SymbolStorePath\u0026#34;, @\u0026#34;\\serversymbolssomepath\u0026#34;); buildDef.ProcessParameters = WorkflowHelpers.SerializeProcessParameters(process); //Retention policy buildDef.RetentionPolicyList.Clear(); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Succeeded, 10, DeleteOptions.All); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Failed, 10, DeleteOptions.All); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Stopped, 1, DeleteOptions.All); buildDef.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.PartiallySucceeded, 10, DeleteOptions.All); //Lets save it buildDef.Save(); Hope you find this useful!\nComments Imported from the original WordPress site. Closed for new replies.\nSarkis — 28 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/01/15/creating-a-build-definition-using-the-tfs-2013-api.aspx#636720\nThanks for the valuable post. Which library is referenced for BuildParameter type?\nSarkis — 28 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/01/15/creating-a-build-definition-using-the-tfs-2013-api.aspx#636721\nI am trying to edit the existing BuildParameters using the API. Could you point me to the right direction?\nI am able to read them using the deserializeprocessparameters as you suggested but not able to edit them.\nThanks,\nSarkis\n\\\nSarkis — 28 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/01/15/creating-a-build-definition-using-the-tfs-2013-api.aspx#636722\nFound the way to set parameters. Here it is:\nprocess[\u0026ldquo;ParamName\u0026rdquo;] = \u0026ldquo;ParamValue\u0026rdquo;;\nbuildDefinition.ProcessParameters = WorkflowHelpers.SerializeProcessParameters(process);\nSarkis — 28 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/01/15/creating-a-build-definition-using-the-tfs-2013-api.aspx#636741\nOne more issue I am having. Somehow DefaultDropLocation is not being saved using the following:\nbuildDefinition.DefaultDropLocation = \u0026ldquo;\\test\u0026rdquo;;\nIs this an MS Bug?\n\\\nZech — 26 Sep 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2014/01/15/creating-a-build-definition-using-the-tfs-2013-api.aspx#640883\nThanks for sharing this. its very useful.\n@Sarkis\nlibrary for BuildParameter Microsoft.TeamFoundation.Build.Common\n","permalink":"https://blog.ehn.nu/2014/01/creating-a-build-definition-using-the-tfs-2013-api/","summary":"\u003cp\u003eAlmost four years ago I \u003ca href=\"http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx\"\u003ewrote a post\u003c/a\u003e 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 \u003cbr\u003e\ndoes 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.\u003c/p\u003e","title":"Creating a Build Definition using the TFS 2013 API"},{"content":"This year at the second MVP summit I presented a new solution for hosting a private extension gallery. Since then I have finished up the code and put it up on the CodePlex site so you can use it as you want to. In this blog post I will walk through the background and how you deploy and use the solution.\nNote: The sourcecode is available at http://inmetavsgallery.codeplex.com/ as a new 2.0 release. I have branched the original source code so that it is still available.\nBackground\nLittle more than a year ago, I blogged about how to host your own private gallery for hosting Visual Studio extensions. The solution that I put up on CodePlex (http://inmetavsgallery.codeplex.com/) was a ASP.NET web service that scans a folder or share and generates the corresponding Atom Feed XML that Visual Studio expects when browsing extensions, using the Extension Manager. See the blog post for details on how this works.\nAlthough this solution works fine (we are using it internally at Inmeta) there are some things that have been nagging me:\nThere is no easy way to upload or update extensions. \\ Since the file system is the data storage, the service rescanned the whole structure on every request, which could become a bottleneck when the number of clients and/or extensions increase \\ I miss some of the features that are available in the “real” Visual Studio Gallery, such as showing the number of downloads and the average rating of each extension The last bullet is what made start looking at how this works in Visual Studio. As you know Visual Studio comes with two extension galleries by default, the Visual Studio Gallery and the Samples Gallery:\nThe standard Visual Studio Gallery\nWhen selecting an extension here, Visual Studio shows among other things how many downloads this extension has, and the average rating together with the number of votes. Also it shows icons for the extension and a small preview image when selected. It is also possible to search on different metadata, such as popularity, number of downloads or most recent for example. All in all, this is a much nicer experience than what the was possible using the official private extension gallery mechanism.\nWhen I dug into the details of how this works, it turns out that Visual Studio internally uses a completely different protocol for communicating with these two galleries. It uses a standard (but completely undocumented) WCF SOAP service with the following interface:\nThe WCF SOAP interface that Visual Studio communicates with\nSo basically, there are methods available for displaying the category tree (GetRootCategories(2) and GetCategoryTree(2)), checking for updates (GetCurrentVersionsForVsixList) and for searching available extensions (SearchReleases(2)). You can see how these methods matches to how the Visual Studio Extension Manager works when you browse, search and update your extensions.\nSo, with a (lot of) help from Fiddler I decrypted the protocol that was used and managed to implement a service that works in the same way that the Visual Studio Gallery does.\n**Solution **The new version of the Inmeta Gallery is a ASP.NET web application that consists of three parts:\nA WCF service implementing the IVsIdeService interface An ASP.NET web application where you can upload and rate visual studio extensions A SQL database for storing the extensions. Inmeta Visual Studio Gallery overview\nThis makes it easy to deploy, it is just one web application that contains both the service that VS communicates with and the web application where you can browse and upload the extensions.\nThe web application is simple, it shows the 10 most downloaded extensions together with the same information that you see in Visual Studio, and you can search extension by name or description. Here is a screenshot:\nScreenshot of the Inmeta Visual Studio Extension Gallery\nWhen select an extension you will see the full details of the extension, as shown below. Here you can download the extension, give it a rating and if desired delete it completely.\nExtension details page\nNote that if you rate it you need to press Update to store the new value.\nDeployment\nServer The CodePlex release for this solution is a simple web deploy package, that you can deploy to a local or remote IIS web server. I’ve attached the standard files from the Visual Studio publising wizard, so you’ll get the command files that simplifies the deployment, See http://msdn.microsoft.com/en-us/library/dd465323(v=vs.110).aspx for information on creating and deploying a Web Deploy Package using Visual Studio. Note that the web application is using Entitiy Framework Code First which means that it will try to create the database the first time the code is executed. In order to do so, it must have proper permission on the target SQL server of course. If you need to deploy the database in any other manner, just download the source code take it from there. \\ Client It is not possible to add a private extension gallery of this type using Visual Studio, it will always create a Atom Feed gallery extension point. Since these settings are stored in the registry, it is easy to do this using a .reg file. The registry settings for a Visual Studio Gallery looks like this: Note the VSGallery string that is highlighted in te image above. This is the “secret” setting that causes Visual Studio to use the WCF protocol instead of the simple Atom Feed protocol There is a .reg file available on the CodePlex site that you can use for registering the gallery for every client. Hopefully you wil find this new version of the Inmeta Visual Studio Gallery service usable, please post any issues and/or suggestions to the CodePlex site!\nComments Imported from the original WordPress site. Closed for new replies.\nzzz — 11 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/12/26/inmeta-visual-studio-extension-gallery-ndash-version-2.0.aspx#636228\nTry going to Tools Options Extension manager and add a Private Gallery. It will add a gallery to the Extension manager using VS\u0026rsquo; supported features.\nSelvaraj — 20 Feb 2018\nHi All,\nI have created Private Gallery in VS2015 for to upload my own 40 numbers of VSIX extensions. In my current scenario I can see my VSIX extensions in my page. But with addition to that, I can see \u0026ldquo;Page Index\u0026rdquo; at bottom which is like 1 2 3.. All my VSIX extensions are shown in current page itself. Page numbers are showing unnecessarily. And clicking of that page number is just showing the duplicate of current page only. How to hide that Page index at bottom of my Private Gallery page? Please help me out of this. It happens only when we have more number of extensions in gallery. Above 30 extensions.\nDetails:\nSystem : Win7\nVS Version : 2015\nVSIX Loading from : SQL Server 2014\nPrivate Gallery Mode : VSGallery\n","permalink":"https://blog.ehn.nu/2013/12/inmeta-visual-studio-extension-gallery-version-2-0/","summary":"\u003cp\u003eThis year at the second MVP summit I presented a new solution for hosting a private extension gallery. Since then I have finished up the code and put it up on the CodePlex site so you can use it as you want to. \u003cbr\u003e\nIn this blog post I will walk through the background and how you deploy and use the solution.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e\u003cbr\u003e\nNote: The sourcecode is available at \u003ca href=\"http://inmetavsgallery.codeplex.com/\" title=\"http://inmetavsgallery.codeplex.com/\"\u003ehttp://inmetavsgallery.codeplex.com/\u003c/a\u003e as a new 2.0 release. I have branched the original source code so that it is still available.\u003c/strong\u003e\u003c/p\u003e","title":"Inmeta Visual Studio Extension Gallery – version 2.0"},{"content":"Yesterday, on September 12th, we arranged a Visual Studio Community Day 2013 at Mesh in central Oslo. The agenda was in two parts, first we talked about how you can improve your delivery cadence by using Visual Studio ALM. We went through all stages including planning, developing, testing and deployment. In the second part, we showed some of the new goodies in Visual Studio 2013, where we focused mostly on Git and InRelease which are the two major additions in Visual Studio 2013 ALM. Unfortunately we didn’t have the time to go through everything that we wanted, but we have put up links and some more information on our public GitHub site, at https://github.com/Inmeta/public/wiki/VS2013-Community-Day\nWe had a lot of fun presenting and we got some great feedback during and after the event.\nHere is a picture showing me, Terje Sandstrom and (in the foreground) Lars Nilsson who hosted the event.\nThanks to Microsoft Norway for arranging this event!\n","permalink":"https://blog.ehn.nu/2013/09/inmeta-visual-studio-2013-community-day/","summary":"\u003cp\u003eYesterday, on September 12th, we arranged a Visual Studio Community Day 2013 at \u003ca href=\"http://meshnorway.com\"\u003eMesh\u003c/a\u003e in central Oslo. The agenda was in two parts, first we talked about how you can improve your delivery cadence by using Visual Studio ALM. \u003cbr\u003e\nWe went through all stages including planning, developing, testing and deployment. In the second part, we showed some of the new goodies in Visual Studio 2013, where we focused mostly on Git and InRelease which are the two major additions in Visual Studio 2013 ALM. Unfortunately we didn’t have the time to go through everything that we wanted, but we have put up links and some more information on our public  GitHub site, at \u003ca href=\"https://github.com/Inmeta/public/wiki/VS2013-Community-Day\"\u003ehttps://github.com/Inmeta/public/wiki/VS2013-Community-Day\u003c/a\u003e\u003c/p\u003e","title":"Inmeta Visual Studio 2013 Community Day"},{"content":"As you probably already know, Microsoft recently acquired InRelease, a release management product build by InCycle software that integrates tightly with Team Foundation Server. This acquisition fills a huge gap in the Visual Studio ALM suite, letting customers handle the release management and automatic deployment of their solution. This is a crucial feature for enabling Continuous Deployment.\nIn this post I will show you how to get started with using InRelease, by installing it and setting up your first release including automatic deployment to a staging server. I expect to blog some more about InRelease in the near future, looking at the nitty gritty details of release automation and deployment using InRelease.\nNote: Both TFS 2013 and this edition of InRelease are still in preview and details can change in time for the RTM version.\nInRelease Overview A deployment of InRelease typically looks like this:\nSo we have three main components here:\n**InRelease Server **The server consists of both a windows and a web service that the deployers and clients communicates with (using HTTP/HTTPS). \\ **InRelease Deployer **The Deployer is a windows service that is installed on each target server where you want to deploy your applications. Like Visual Studio Lab Management, you can define environments that consist of several servers (physical or virtual). But each servers needs to have a deployer agent installed to be able to carry out the actual deployment. \\ InRelease Client There are in fact two clients. There is a WPF application that is the main interface for managing all release information. In addition there is a web application where users can act on approval requests, that is sent out using email. \\ InRelease Concepts There are several concepts in InRelease that you need to understand in order to fully utilize it. These concepts are related to each other as well, and it can be a bit tricky in the beginning to understand how they relate to each other.\nStage Type This corresponds to a set of logical steps that are required to move your application build from development all the way to production. Typically you will have stages for Development, QA, User Acceptance Test, Production etc. \\ Technology Type These are basically tags that allow you to specify what kind of technologies that are used on your target servers and environments. These tags are used by InRelease for anything, they are merely informational values. \\ Environment As mentioned above, an environment consist of one or more servers. \\ Server In order to deploy your application, you need to register your target servers in InRelease. Add the servers using the DNS name and InRelease will register the IP address of the server that first time the Deployer agent on that machine communicates with the Server. \\ Release Path A Release Path is how you distribute a release in a certain scenario. Even though you will often use the same release path every time for your application, you might for example define one release path for major releases and another release path for minor/hotfix releases, since these might have different pre- or post validation steps. \\ Release Template A Release Template is the workflow that is used for releasing an application. Users that are familiar with TFS Build will find themselves at home here, since InRelease also uses Windows Workflow for create the deployment orchestration, by using a sequence predefined Workflow Activities. \\ **Release **Defines a specific release of an application or system. A release is defined by associating it with a Release Template, a Stage Type and a Build. You want to use TFS Build here and associate the Release Template with a corresponding TFS Build, but it is also possible to use a UNC path as the source of deployment items, in case you for example use Team City as your build automation tool. \\ Tool Represents an executable piece of code, for example a PowerShell or a batch file, or an executable. The only real important thing here is that it is possible to execute the tool silently from command line. A tool is always used by either an Action or a Component \\ Action An object in InRelease that can be used in a deployment sequence. Often this is a tool with the corresponding command and parameters, such as MSI Deployer or Windows Process. \\ Component Part of an application that needs to be installed. For example a database, web site or a windows service. A component has a source, which often is fetched from the TFS Build drop folder Installing InRelease The installation procedure is pretty straight forward except some minor issues that should be improved by RTM. Martin Hinshelwood has posted some of these issues here, here and here.\nThe InRelease Server uses SQL Server to store all its information, this can be basically any version, and can be hosted remotely. In addition, the InRelease server has the following prerequirements, so make sure that you install/enabled these features before:\nNote that it is possible to run on IIS 6 as well, check the installation manual\nAfter you have installed everything, you first need to add users. Start the InRelease Client and go to Administration –\u0026gt; Users: \\\nSelect the windows account by browsing your AD directory. This will automatically fill out the name and email address for you, as long as this information is available in AD. Also mark if the user is a Release Manager and/or a Service User. Release Managers have access to everything, and Service Users are used for deployer accounts and TFS build service account. These users won’t show up in any lists where you select users.\nNext up, you need to register the connection to TFS. Enter the name of your TFS server, and the credentials that should be used for accessing it. \\\nVerify that the TFS connection works properly, after this you should be good to go and start creating releases!\nCreating and deploying a Release Lest walk through how to get started quickly, by creating a new release and deployment sequence for an application. In this case, I am reusing our existing release build for this application, but will manage and deploy it using InRelease. This build already produces an MSI (using Wix) so we will use an existing InRelease tool called MSI Deployer, that is capable of executing a MSI with custom parameters as part of the deployment.\nThese are the steps that we will walk through:\nDefine the Stage Types Create an Environment for the test server Register the test server Create a Release Path for our release Setup a component that installs our MSI Create a Release Template that uses the component Create a Release Define the Stage Types We will setup to stage types here, one for Test and one for Production. Go to Administration –\u0026gt; Pick List and select Stage Types. Create two Stage Types, called Test and Production:\nDefine the staging server in InRelease Now we will register our existing test server used for staging the application. This is the server where we have installed the InRelease Deployer agent, which is used for running the deployment sequence on that machine. Note that a release can of course reference many servers, and each server has its own steps in the deployment sequence.\nHere I have registered the customer test server, running on our lab network. I have assigned myself as the owner of this server, and added a short description. In addition I have used the default option of how the InRelease Deployer should access the build drop location, namely directly through the UNC path. If this is a problem, which it can be due to security restrictions, you can use the other option in which the InRelease Server accesses the drop location and the InRelease Deployer agents gets the files from the IR Server using HTTP(S). This is slower, especially if you have large files.\nNote the error that is shown. This means that the InRelease Deployer on the server have not yet communicated with the server. As soon as it does, the error will disappear and the IP Address will be filled out.\nCreate an Environment for the test servers We also need to create environments for each stage type. In this case, each environment will only consist of one server, but often you will have several servers, such as web servers, database server, application servers and so on.\nHere I have created a Test environment that includes the test server. I will also create a Production environment for the production server(s).\nCreate a Release Path for our release Now lets define how the release should flow through the different stages. We will define how each stage should be handled, if the deployment is automatic or not, and if the different steps should be validated and approved by someone.\nAs you can see I have added both stages here, but the different steps are a bit different for each step. On the test server I want to automate the acceptance and validation step, and I will approve the deployment afterwards myself. In the production environment, the release first have to be accepted (by my colleague Terje in this case 🙂 ) before the deployment proceeds. Also, Terje will be validating and approving the release in the production environment. \\\nSetup a component that installs our MSI Before create the release template, we need to create a component that will install our MSI. As mentioned before, components can be reused in multiple release template, by using arguments. So first we give the component a name and then point to where the package that belongs this component can be retrieved:\nIn my case, all the MSI’s from the TFS build is located at the drop folder root. In this case, I must add a ‘’ in the Build Drop Location to have InRelease understand that.\nNote the the build definition will be defined in the Release Template. We could also choose to select an independent build, basically any build that has already been executed. We could also point to a UNC share, which would allow us to use InRelease without TFS Build, for example is you use TeamCity.\nNext we select the Deployment tab, in which we specify how this component is actually installed. Here we can select from a list of predefined tools, in this case we select the MSI Deployer tool. Each tool has its own set of commands, arguments and parameters. A sample argument will be created when selecting the tool, so all you need to do is to change the parameter values to match your packages.\nThe MSI Deployer tool, like many other InRelease tools, uses Powershell as implementation. Here I have referenced my installer and added the specific MSI argument that is needed in order to deploy it on the test server, such as web site name, port, app pool and install directory.\nCreate a Release Template that uses the component Now lets create a Release Template that utilizes this component. Go to Configure Apps –\u0026gt; Release Template and create a new template. Fill out a name and description, and select the Release Path that we just created. Also, we can select which build definition that belongs to this release template. This is where the component will fetch its packages from, and it also allows us to later on automatically trigger a release from a build, as I will show in a later post.\nNext up we define the Deployment sequence for each stage of the corresponding Release Path, which in our case is Test and Production. You will that in addition to the existing predefined tools the servers and components that you have defined show up in the toolbox.\nHere I have first dragged the server onto the workflow surface, and then added the Customer Web Site MSI installer inside the Server activity. This signals that the component shall be executed on that server. I could very well have multiple servers here, and tools/components are always placed within a server node.\nOf course there are a lot more things that you can do here, there are tools for creating and configuring web sites, SQL databases, Windows Services and starting and stopping Azure VMs. In my case, I already had an MSI from before, so all I need to do here is to make sure that it is executed with the correct parameters.\nCreate a Release Finally, it is time to actually release something 🙂\nBy selecting the Release Template, we can click on New Release to create a new Release for this release path. Here we select which Target Stage that we should release to, and which build that should be deployed.\nHere I have clicked on Latest, which automatically finds the latest build for my associated build definition, but it is also possible to select a previous build.\nNow I can select Create in Draft which allows me to postpone the release for later, or I can be bold and click in Start immediately.\nHere we can see that the Release is in progress, and the first three steps are already done. Remember that we set the Accept Deployment step and the Validate Deployment step to automatic for the Test stage. The Deploy step has executed in about 3 seconds, and we can view the log by clicking the button in the Details column.\nFinally, the release has stopped in the Approve Release step. This step is manual, and is waiting for me to approve the release. To make this workflow happen, I have received the following email from the InRelease Server:\nAfter I have surface tested the deployment and verified if it meets the quality gates defined for the release or not, I can click the View Request link which will redirect me to the InRelease web application where I can select to Approve or Reject the release.\nConclusion This post has shown how you quickly can get started with InRelease and TFS 2013. As mentioned before, this is still prerelease software, so there are still some know bugs in the software.\nComments Imported from the original WordPress site. Closed for new replies.\nMike G — 23 Aug 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/08/23/getting-started-with-inrelease-and-tfs-2013-preview.aspx#631535\nI installed and evaluated InRelease a few weeks ago for my company. Its good to see that the installer\u0026rsquo;s prerequirements check is making improvements. I know it was mentioend in the install guide, but it would be nice if the installer itself also checked and verified the prereqs are present.\nThings that got me:\\\n.NET Framework 4.5 wasn\u0026rsquo;t present\\ TFS Team Explorer wasn\u0026rsquo;t present\nOther improvements:\\ Your install guide said IIS6 Metabase compatibility was needed, but it didn\u0026rsquo;t differentiate on what server(s) it was needed. The InRelease server itself, the agents, etc.?\\ It would be nice if the installer opened the firewall port which the user selected for the InRelease software. John Hughes — 20 Oct 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/08/23/getting-started-with-inrelease-and-tfs-2013-preview.aspx#632840\nIt doesn\u0026rsquo;t appear that InRelease is included in the TFS or VS 2013 RTM? Is there any information available on when InRelease wll be available past the preview?\nlior — 12 Dec 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/08/23/getting-started-with-inrelease-and-tfs-2013-preview.aspx#634249\ncan i connect it with Ths and GIT ?\nkimbostan — 29 Jan 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/08/23/getting-started-with-inrelease-and-tfs-2013-preview.aspx#635343\nCould you tell me if InRelease is compatible with deploying Microsoft Dynamics AX? (using TFS). Thanks!\n","permalink":"https://blog.ehn.nu/2013/08/getting-started-with-inrelease-and-tfs-2013-preview/","summary":"\u003cp\u003eAs you probably already know, Microsoft \u003ca href=\"http://blogs.msdn.com/b/bharry/archive/2013/07/10/inrelease-acquisition-is-complete.aspx\"\u003erecently acquired InRelease\u003c/a\u003e, a release management product build by InCycle software that integrates tightly with Team Foundation Server. This acquisition fills a huge gap in the Visual Studio ALM suite, letting customers handle the release management and automatic deployment of their solution. This is a crucial feature for enabling Continuous Deployment.\u003c/p\u003e\n\u003cp\u003eIn this post I will show you how to get started with using InRelease, by installing it and setting up your first release including automatic deployment to a staging server. I expect to blog some more about InRelease in the near future, looking at the nitty gritty details of release automation and deployment using InRelease.\u003c/p\u003e","title":"Getting started with InRelease and TFS 2013 Preview"},{"content":"The last couple of months I have been working together with Mathias Olausson, Mattias Sköld and Joachim Rossberg on a new book project for Apress that has just been published. The book is called Pro Team Foundation Service and covers all aspects of working with Team Foundation Service, Microsoft\u0026rsquo;s hosted version of Team Foundation Server in the cloud. I have mainly worked on the chapter related to automated build and continuous deployment, but also with some of the other chapters.\nIt has been a quite hectic project due to a tight schedule, but at the same time it has been a lot of fun to work on this book together with late night meetings and weekends filled with book writing and chapter editing.\nDuring the project we’ve had great help from several people at Microsoft, Jamie Cool, Will Smythe, Anutthara Bharadwaj, Ed Blankenship and Vijay Machiraju. Also a big thanks to Brian Harry for writing the foreword to the book. In addition I’d like to thank my colleague Terje Sandstrøm for helping out with Technical Review of large parts of the book.\nHere is some information about the book, you can find it on Amazon here: http://www.amazon.com/Team-Foundation-Service-Mathias-Olausson/dp/1430259957#_\nCheck it out and let us know what you think!\nPro Team Foundation Service gives you a jump-start into Microsoft’s cloud-based ALM platform, taking you through the different stages of software development. Every project needs to plan, develop, test and release software and with agile practices often at a higher pace than ever before. Microsoft\u0026rsquo;s Team Foundation Service is a cloud-based platform that gives you tools for agile planning and work tracking. It has a code repository that can be used not only from Visual Studio but from Java platforms and Mac OS X. The testing tools allow testers to start testing at the same time as developers start developing. The book also covers how to set up automated practices such as build, deploy and test workflows.\nThis book:\n· Takes you through the major stages in a software development project.\n· Gives practical development guidance for the whole team.\n· Enables you to quickly get started with modern development practices.\nWith Microsoft Team Foundation Service comes a collaboration platform that gives you and your team the tools to better perform your tasks in a fully integrated way.\nWhat you’ll learn\n· What ALM is and what it can do for you.\n· Leverage a cloud-based ALM platform for quick improvements in your development process.\n· Improve your agile development process using integrated tools and practices.\n· Develop automated build, deployment and testing processes.\n· Integrate different development tools with one collaboration platform.\n· Get started with ALM best-practices first time round.\nWho this book is for\nPro Team Foundation Service is for any development team that wants to take their development practices to the next level. Microsoft Team Foundation Service is an excellent platform for managing the entire application development lifecycle and being a cloud-based offering it is very easy to get started. Pro Team Foundation Service is a great guide for anyone in a team who wants to get started with the service and wants to get expert guidance to do it right.\nTable of Contents\nIntroduction to Application Lifecycle Management\nIntroduction to Agile Planning, Development, and Testing\nDeciding on a Hosted Service\nGetting Started\nWorking with the Initial Product Backlog\nManaging Team and Alerts\nInitial Sprint Planning\nRunning the Sprint\nKanban\nEngaging the Customer\nChoosing Source Control Options\nWorking with Team Foundation Version Control in Visual Studio\nWorking with Git in Visual Studio\nWorking in Heterogeneous Environments\nConfiguring Build Services\nWorking with Builds\nCustomizing Builds\nContinuous Deployment\nAgile Testing\nTest Management\nLab Management\n","permalink":"https://blog.ehn.nu/2013/05/new-book-pro-team-foundation-service/","summary":"\u003cp\u003eThe last couple of months I have been working together with \u003ca href=\"http://msmvps.com/blogs/molausson/\"\u003eMathias Olausson\u003c/a\u003e, \u003ca href=\"http://mskold.blogspot.se/\"\u003eMattias Sköld\u003c/a\u003e and \u003ca href=\"https://www.apress.com/index.php/author/author/view/id/2328\"\u003eJoachim Rossberg\u003c/a\u003e on a new book project for \u003ca href=\"http://www.apress.com/\"\u003eApress\u003c/a\u003e that has just been published. The book is called \u003cstrong\u003e\u003ca href=\"http://www.apress.com/microsoft/workflow/9781430259954\"\u003ePro Team Foundation Service\u003c/a\u003e\u003c/strong\u003e and covers all aspects of working with Team Foundation Service, Microsoft\u0026rsquo;s hosted version of Team Foundation Server in the cloud. I have mainly worked on the chapter related to automated build and continuous deployment, but also with some of the other chapters.\u003c/p\u003e","title":"New Book: Pro Team Foundation Service"},{"content":"Extension available at: http://visualstudiogallery.msdn.microsoft.com/9ed2d30c-a692-42b0-a21d-cdc8d2bf322c\nI have been playing around a bit lately with extending Team Explorer 2012, mostly because it is fun but also to fix a little nagging feature that should have been there from the beginning. Often I (and a lot of other people) find myself wanting to associate several consecutive changesets to the same work item. The problem is that Team Explorer does not remember this, instead I have to either remember the ID or use a query that hopefully will match the work item.\nWhere is the work item that I just associated with? True, when using the My Work page and the teams and sprint backlogs are correctly setup, you can find “your” work items there, but every so often this is not the case, and off I go to locate that work item again.\nSo this seemed to be a good feature to implement and at the same time learn a little about how to extend Team Explorer in Visual Studio 2012.\nThere is a great sample posted by Microsoft over at MSDN, it also talks about the main extension points and classes/interfaces that you need to know about. You can find it here: http://code.msdn.microsoft.com/windowsdesktop/Extending-Explorer-in-9dccd594. If you have developed extensions to Visual Studio before, you will be relieved to know that this new extension model for Team Explorer is purely based on standard .NET/WPF and MEF, no weird COM interfaces.\nYou can add new pages to Team Explorer, you can add new sections to existing pages and you can add navigation links to the Home screen. All these extensions are discovered by Team Explorer using the Managed Extensibility Framework (MEF). You just need to attribute your classes with the correct attribute and it will be found by Team Explorer. The attributes also control where your extension will appear. This extension is a Section that should appear inside the Pending Changes page:\nExample of attributing a Team Explorer extension\nThe last property (35) is a priority number that controls when the extension is created and also where it will placed relative to the other sections. The existing Related Work Items section has priority 30, so 35 will place our extension right below it.\nWe also need to implement the ITeamExplorerSection interface, that contains properties and methods that needs to be implemented for anything to show up.\nITeamExplorerSection interface\nThe most interesting property here is the SectionContent property which is where you return the content of your extensions. This is typically a WPF user control in which you can add any controls you like.\nThis is how the extension appear inside the Pending Changes page. It will analyze your recent changesets in the current team project and extract the last 5 associated work items and show them in a list. From the list you can then easily add a work item to the current pending changes by right-clicking on it and select Add. You’ll note that the work item will then disappear from the list, since you are not likely interested in adding it again.\nRecently Associated Work Item section\nI encourage you to read the MSDN article for more information about the possibilities to extend Team Explorer 2012. Also, try out the extension and let me know it you find it useful!\nComments Imported from the original WordPress site. Closed for new replies.\nBen Barreth — 16 May 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/05/16/extending-team-explorer-2012-ndash-associating-recent-work-items.aspx#628741\nAwesome post Jakob. The more people that mess around with customizing their TFS environment, the better, in my humble opinion. Too many times it\u0026rsquo;s considered a black box that teams don\u0026rsquo;t know how to fully customize to meet their needs.\nJakob Ehn — 17 May 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/05/16/extending-team-explorer-2012-ndash-associating-recent-work-items.aspx#628754\nThanks Ben, glad you liked it\nEduardo Elias Saleh — 23 Jul 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/05/16/extending-team-explorer-2012-ndash-associating-recent-work-items.aspx#638998\nAwesome extension and post \u0026hellip; Very instructive \u0026hellip; I was wandering if you can share the extension\u0026rsquo;s source code, as a didatic example.\nThanks, in advance! :D\nJakob Ehn — 18 Nov 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/05/16/extending-team-explorer-2012-ndash-associating-recent-work-items.aspx#641460\n@Eduardo: I plan to extend this functionality to support Git as well very soon, when I do that I\u0026rsquo;ll post the source to CodePlex/Github\nEduardo Elias Saleh — 16 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/05/16/extending-team-explorer-2012-ndash-associating-recent-work-items.aspx#644797\nSo, when you do release it, could you please link it here? Thanks in advance and, again, congrats \u0026hellip; this IS a very nice tool.\nDon Wilcox — 24 Aug 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/05/16/extending-team-explorer-2012-ndash-associating-recent-work-items.aspx#645929\nThere seems to be a bug in displaying the highlight, at least with the dark theme in VS 2015.\nOther than that, thanks so much for the extension.\n","permalink":"https://blog.ehn.nu/2013/05/extending-team-explorer-2012-associating-recent-work-items/","summary":"\u003cp\u003e\u003cstrong\u003eExtension available at:\u003c/strong\u003e \u003ca href=\"http://visualstudiogallery.msdn.microsoft.com/9ed2d30c-a692-42b0-a21d-cdc8d2bf322c\" title=\"http://visualstudiogallery.msdn.microsoft.com/9ed2d30c-a692-42b0-a21d-cdc8d2bf322c\"\u003ehttp://visualstudiogallery.msdn.microsoft.com/9ed2d30c-a692-42b0-a21d-cdc8d2bf322c\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eI have been playing around a bit lately with extending Team Explorer 2012, mostly because it is fun but also to fix a little nagging feature that should have been there from the beginning. Often I (and a lot of other people) find myself wanting to associate several consecutive changesets to the same work item. The problem is that Team Explorer does not remember this, instead I have to either remember the ID or use a query that hopefully will match the work item.\u003c/p\u003e","title":"Extending Team Explorer 2012 – Associating Recent Work Items"},{"content":"\nRunning Static Code Analysis (SCA) is something that you should be doing regularly to verify your code base against a large set of rules that will check your code for potential problems and how it comply with standard patterns such as naming conventions for example. Microsoft include several different rule sets that you can use for starters, but you can build your own rule sets as well, that contain the rule that you want to use, In addition, you can write your own custom rules and add these to your rule sets.\nWhat you will notice quickly when you start running SCA for larger solutions is that it can take a lot of time. Therefore, you normally don’t want to run this on your local build but instead run it as part of your automated builds. It is recommended to set up a specific build for your projects that measures code quality, by running for example SCA, Code Metrics and Code Coverage. All these things take time to complete, so don’t put these in your Check-In builds, but in a Quality Assurance (QA) build.\nConfiguring Static Code Analysis With Team Foundation Build, it is easy to run Static Code Analysis as part of the build, just modify the Perform Code Analysis process parameter in your build definition:\nThere are three possible values that you can use here:\nNever – Never run Static Code Analysis As Configured – If the project is configured to run Static Code Analysis for the current configuration, then SCA will be executed Always – Always run Static Code Analysis, independent of how the projects are configured If you select As Configured, you need to make sure that you have configured your projects correctly. This is done by opening the Properties window for your project and select the Code Analysis tab:\nAs you can see, the Code Analysis settings are specific to the Configuration and Platform for the project. This means that you can, for example, run code analysis only on Debug builds and not on Release builds.\nNow, while using project specific settings like this to control when SCA is executed works, it has some drawbacks. When the solutions start to grow in size, it can be hard to make sure that the settings in every project is correctly configured. Also, as mentioned before, you typically don’t want to run SCA at all on your local builds, since it makes your build times longer. This can be solved by for example making sure that only the Release configuration has the Enable Code Analysis on Build property set to true, and then you only build the Debug configuration locally.\nA better way to solve this is to control this completely from the build definition instead. You do this by setting the Perform Code Analysis process parameter to Always, as shown above. This will make sure that SCA are run for all projects, no matter how they are configured.\nRunning SCA for specific configurations\nA problem that we faced recently at a customer that are running big builds (1+ hours) is that they are building both the and Debug and Release configurations as part of their builds. We wanted to run SCA on these builds, and we don’t want to configure each project (the solutions has 150+ projects in it). But, setting Perform Code Analysis to Always, this will result in SCA being run for both Debug and Release builds resulting in a considerable increase in build time.\nSo, how can we make sure that SCA is executed on all projects, but only on on (or several) configurations? One way of doing this is to customize your build template and add a parameter that specifies these configurations.\nHere are the steps to accomplish this:\nIf creating a new build template from scratch, branch the DefaultTemplate.11.1.xaml build process template. \\\nOpen the template in Visual Studio \\\nSelect the top Sequence activity and expand the Arguments tab \\\nAt the bottom of the list, add a new parameter called RunSCAForTheseConfigurations with StringList as type \\\nLocate the MetaData process parameter and click on the browse button on the very right \\\nAdd a new entry for the new parameter \\\nInside the workflow, locate the MSBuild activity that is used for compiling the projects. It is right at the end of the Compile the Project sequence: \\\nRight-click the MSBuild activity and select Properties \\\nLocate the RunCodeAnalysis property and open the expression editor \\\nEnter the following expression The expression evaluates if the current configuration (platformConfiguration.Configuration) is specified in our new property.\nSave the workflow and check it in\nNow you can create a new build definition and enter one or more configurations in the new property:\nSince this is a property of type StringList, you can add multiple configurations here if you want to.\nYou can see from this build summary that SCA has only been performed on the Debug configuration, and not for Release.\nConclusion\nI have shown one way to implement automatically running Static Code Analysis on a subset of configurations for a build that builds multiple solutions. This is very useful when you have large builds that compile multiple configurations.\nHope you found this post useful.\nComments Imported from the original WordPress site. Closed for new replies.\nJeremy Thake — 01 Feb 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/01/20/tfs-build-running-static-code-analysis-for-specific-configuration.aspx#624628\nThanks for the post\u0026hellip;but what you don\u0026rsquo;t mention is that a vanilla install of TFS2012 won\u0026rsquo;t even run Static Code Analysis and that you require to install either Visual Studio 2012 Premium or Ultimate on the build server. Is there a way around this?\nJakob Ehn — 02 Feb 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/01/20/tfs-build-running-static-code-analysis-for-specific-configuration.aspx#624631\n@Jeremy: No, you need to install Visual Studio in order to run Static Code Analysis on the build server. However, in VS 2012, the Professional edition should be enough. See the feature chart here:\nhttp://www.microsoft.com/visualstudio/eng/products/compare\nAnna Holland — 04 Mar 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2013/01/20/tfs-build-running-static-code-analysis-for-specific-configuration.aspx#625703\nHi Jakob, You have great blog content and found it via Twitter. My name is Anna, and I am a Marketing Coordinator at Syncfusion. I am reaching out to see if you would blog about one of our free e-books, collectively known as the Succinctly series. It is a great way to add value to your personal website. For more information please contact me at annah@syncfusion.com. I look forward to hearing from you!\n","permalink":"https://blog.ehn.nu/2013/01/tfs-build-running-static-code-analysis-for-specific-configuration/","summary":"\u003cp\u003e\u003cbr\u003e\nRunning Static Code Analysis (SCA) is something that you should be doing regularly to verify your code base against a large set of rules that will check your code for potential problems and how it comply with standard patterns such as naming conventions for example. Microsoft include several different rule sets that you can use for starters, but you can build your own rule sets as well, that contain the rule that you want to use, In addition, you can write your own custom rules and add these to your rule sets.\u003c/p\u003e","title":"TFS Build: Running Static Code Analysis for Specific Configuration"},{"content":"\nDuring the summer and fall this year, me and my colleague Terje Sandstrøm has worked together on a book project that has now finally hit the stores! The title of the book is Team Foundation Server 2012 Starter and is published by Packt Publishing.\nYou can find it at http://www.packtpub.com/team-foundation-server-2012-starter/book or from Amazon http://www.amazon.com/dp/1849688389 The book is part of a concept that Packt have with starter-books, intended for people new to Team Foundation Server 2012 and who want a quick guideline to get it up and working. It covers the fundamentals, from installing and configuring it, and how to use it with source control, work items and builds. It is done as a step-by-step guide, but also includes best practices advice in the different areas. It covers the use of both the on-premises and the TFS Services version. It also has a list of links and references in the end to the most relevant Visual Studio 2012 ALM sites.\nOur good friend and fellow ALM MVP Mathias Olausson have done the review of the book, thanks again Mathias!\nWe hope the book fills the gap between the different online guide sites and the more advanced books that are out. Check it out and please let us know what you think of the book!\nBook Description Your quick start guide to TFS 2012, top features, and best practices with hands on examples\nOverview\nInstall TFS 2012 from scratch Get up and running with your first project Streamline release cycles for maximum productivity In Detail\nTeam Foundation Server 2012 is Microsoft\u0026rsquo;s leading ALM tool, integrating source control, work item and process handling, build automation, and testing.\nThis practical \u0026ldquo;Team Foundation Server 2012 Starter Guide\u0026rdquo; will provide you with clear step-by-step exercises covering all major aspects of the product. This is essential reading for anyone wishing to set up, organize, and use TFS server.\nThis hands-on guide looks at the top features in Team Foundation Server 2012, starting with a quick installation guide and then moving into using it for your software development projects. Manage your team projects with Team Explorer, one of the many new features for 2012.\nCovering all the main features in source control to help you work more efficiently, including tools for branching and merging, we will delve into the Agile Planning Tools for planning your product and sprint backlogs.\nLearn to set up build automation, allowing your team to become faster, more streamlined, and ultimately more productive with this \u0026ldquo;Team Foundation Server 2012 Starter Guide\u0026rdquo;.\nWhat you will learn from this book\nInstall TFS 2012 on premise Access TFS Services in the cloud Quickly get started with a new project with product backlogs, source control, and build automation Work efficiently with source control using the top features Understand how the tools for branching and merging in TFS 2012 help you isolate work and teams Learn about the existing process templates, such as Visual Studio Scrum 2.0 Manage your product and sprint backlogs using the Agile planning tools Approach\nThis Starter guide is a short, sharp introduction to Team Foundation Server 2012, covering everything you need to get up and running.\nWho this book is written for\nIf you are a developer, project lead, tester, or IT administrator working with Team Foundation Server 2012 this guide will get you up to speed quickly and with minimal effort.\n","permalink":"https://blog.ehn.nu/2012/11/book-team-foundation-server-2012-starter-published/","summary":"\u003cp\u003e\u003cbr\u003e\nDuring the summer and fall this year, me and my colleague \u003ca href=\"http://geekswithblogs.net/terje/Default.aspx\"\u003eTerje Sandstrøm\u003c/a\u003e has worked together on a book project that has now finally hit the stores! \u003cbr\u003e\nThe title of the book is \u003cstrong\u003eTeam Foundation Server 2012 Starter\u003c/strong\u003e and is published by \u003ca href=\"http://www.packtpub.com/\"\u003ePackt Publishing\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eYou can find it at \u003ca href=\"http://www.packtpub.com/team-foundation-server-2012-starter/book\" title=\"http://www.packtpub.com/team-foundation-server-2012-starter/book\"\u003ehttp://www.packtpub.com/team-foundation-server-2012-starter/book\u003c/a\u003e or from Amazon \u003ca href=\"http://www.amazon.com/dp/1849688389\" title=\"http://www.amazon.com/dp/1849688389\"\u003ehttp://www.amazon.com/dp/1849688389\u003c/a\u003e \u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://gwb.blob.core.windows.net/jakob/WindowsLiveWriter/BookTeamFoundationServer2012StarterPubli_11A91/image_2.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2012/11/book-team-foundation-server-2012-starter-published/17_image_thumb.png\" title=\"image\"\u003e\u003c/a\u003e \u003c/p\u003e\n\u003cp\u003eThe book is part of a concept that Packt have with starter-books, intended for people new to Team Foundation Server 2012 and who want a quick guideline to get it up and working. It covers the fundamentals, from installing and configuring it, and how to use it with source control, work items and builds. It is done as a step-by-step guide, but also includes best practices advice in the different areas. It covers the use of both the on-premises and the TFS Services version. It also has a list of links and references in the end to the most relevant Visual Studio 2012 ALM sites.\u003c/p\u003e","title":"Book “Team Foundation Server 2012 Starter” published!"},{"content":"Updated January 13th 2013: Added note about ASP.NET MVC 4.0 prerequirement\nNote: The installer and the complete source code is available over at CodePlex at the following location: http://inmetavsgallery.codeplex.com\nExtensions and addins are everywhere in the Visual Studio ALM ecosystem! Microsoft releases new cool features in the form of extensions and the list of 3rd party extensions that plug into Visual Studio just keeps growing. One of the nice things about the VSIX extensions is how they are deployed. Microsoft hosts a public Visual Studio Gallery where you can upload extensions and make them available to the rest of the community. Visual Studio checks for updates to the installed extensions when you start Visual Studio, and installing/updating the extensions is fast since it is only a matter of extracting the files within the VSIX package to the local extension folder.\nBut for custom, enterprise-specific extensions, you don’t want to publish them online to the whole world, but you still want an easy way to distribute them to your developers and partners. This is where Private Extension Galleries come into play. In Visual Studio 2012, it is now possible to add custom extensions galleries that can point to any URL, as long as that URL returns the expected content of course (see below).Registering a new gallery in Visual Studio is easy, but there is very little documentation on how to actually host the gallery.\nVisual Studio galleries uses Atom Feed XML as the protocol for delivering new and updated versions of the extensions. This MSDN page describes how to create a static XML file that returns the information about your extensions. This approach works, but require manual updates of that file every time you want to deploy an update of the extension.\nWouldn’t it be nice with a web service that takes care of this for you, that just lets you drop a new version of your VSIX file and have it automatically detect the new version and produce the correct Atom Feed XML?\nWell search no more, this is exactly what the Inmeta Visual Studio Gallery Service does for you :-)\nHere you can see that in addition to the standard Online galleries there is an Inmeta Gallery that contains two extensions (our WIX templates and our custom TFS Checkin Policies). These can be installed/updated i the same way as extensions from the public Visual Studio Gallery.\nInstalling the Service\nThe service uses ASP.NET MVC 4.0, so make sure that you have this installed on your web server. \\ Download the installer (Inmeta.VSGalleryService.Install.msi) for the service and run it. The installation is straight forward, just select web site, application pool and (optional) a virtual directory where you want to install the service. Note: If you want to run it in the web site root, just leave the application name blank \\ Press Next and finish the installer. \\ Open web.config in a text editor and locate the the element \\ Edit the following setting values: \\ **FeedTitle **This is the name that is shown if you browse to the service using a browser. Not used by Visual Studio \\ BaseURI When Visual Studio downloads the extension, it will be given this URI + the name of the extension that you selected. This value should be on the following format: http://SERVER/[VDIR]/gallery/extension/ ** **VSIXAbsolutePath **This is the path where you will deploy your extensions. This can be a local folder or a remote share. You just need to make sure that the application pool identity account has read permissions in this folder \\ Save web.config to finish the installation \\ Open a browser and enter the URL to the service. It should show an empty Feed page: **Adding the Private Gallery in Visual Studio 2012 **Now you need to add the gallery in Visual Studio. This is very easy and is done as follows:\nGo to Tools –\u0026gt; Options and select *Environment –\u0026gt; Extensions and Updates * Press Add to add a new gallery \\ Enter a descriptive name, and add the URL that points to the web site/virtual directory where you installed the service in the previous step \\ Press OK to save the settings. **Deploying an Extension **This one is easy: Just drop the file in the designated folder! :-) If it is a new version of an existing extension, the developers will be notified in the same way as for extensions from the public Visual Studio gallery:\nI hope that you will find this sever useful, please contact me if you have questions or suggestions for improvements!\nComments Imported from the original WordPress site. Closed for new replies.\nJerry — 28 Nov 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#622041\nAny idea what would cause a HTTP/1.1 406 Not Acceptable? When I run the code on my box it works. When I put it on a server I get a 406. I am pretty sure the setup is the same.\nThanks!\nMark Pearl — 29 Nov 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#622049\nThanks, I didn\u0026rsquo;t realize you could do this for extensions. Thanks for sharing\nSeregi — 12 Dec 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#622608\nHello.\nGreat idea. Unfortunately I could\u0026rsquo;t get it working. I made changes in configuration as described:\n\u0026lt;Inmeta.VSGalleryService.Properties.Settings\u0026gt;\nMy VS Gallery\nhttp://localhost/vsgallery\nC:VSIXRepo\n\u0026lt;/Inmeta.VSGalleryService.Properties.Settings\u0026gt;\nBut when I access \u0026ldquo;http://localhost/vsgallery\u0026rdquo; I get emopty page. Folder \u0026lsquo;C:VSIXRepo\u0026rsquo; contains some *.vsix.\nWhat can be wrong?\nSeregi — 12 Dec 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#622611\nSorry. It works perfectly. It\u0026rsquo;d by nice to have ability to add images and icons for extensions :\n\\\nJakob Ehn — 13 Dec 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#622664\n@Seregi: Great, thanks for using the extension gallery. Yes,, I\u0026rsquo;m currently looking into adding support for images at the moment. Please add requests/bugs on the CodePlex site\nDon — 20 Feb 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#625209\nI maintain two instances of Visual Studio 2012. Same install, but two different instances using the rootSuffix switch.\nThis is exactly what I have been looking for. Thanks a lot.\nDave E — 26 Jul 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#631001\nReally helpful, thanks. Any ideas how to add some username and password security to the private gallery?\nJakob Ehn — 30 Sep 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#632392\n@Dave: Sorry, Visual Studio don\u0026rsquo;t support user authentication for galleries, it will not prompt you for credentials but instead just fail with with access denied if you enable authentication on your gallery service\nSascha — 14 Jan 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#634958\nI\u0026rsquo;d really like to use this great tool. But I\u0026rsquo;m having Problems with either 404 errors (path to gallery/Extension-Provlem I guess) when using the server out of box. Or if I modify the method BuildUri in the GalleryController to point to the correct location all I get is a 406 error. I then changed all GetStream calls to use FileAccess.Read in the GalleryController and also gave the Application Pool User Full Control permissions on both the website and the vsix folder location (for testing pruposes only). Unfortunatly that didn\u0026rsquo;t change a thing\u0026hellip;\nI\u0026rsquo;m hosting the gallery server on a IIS8.5 (Server2012 R2) and I\u0026rsquo;m using a dedicated application pool and website, so the gallery server is located in the root.\nAny Ideas?\nBest regards\nSascha\\\nJakob Ehn — 14 Jan 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#634959\n@Sascha: May I recommend you to look at the new version of the Inmeta Visual Studio Gallery that I just published? Among a lot of things, it uses a SQL database for storing extensions so you don\u0026rsquo;t have to struggle with the file permissions etc.\nI blogged about it here:\nhttp://geekswithblogs.net/jakob/archive/2013/12/26/inmeta-visual-studio-extension-gallery-ndash-version-2.0.aspx\nThe solution is deployed on the CodePlex site\nSascha — 14 Jan 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#634961\nThanks for the fast reply! Very much appreciated.\nI do not want to go to SQL Server based version at the moment because we only host a few files there.\nBy accident I just got it working. I had the vsix files located in C:VsixExtensions and that just does not work.\nNow I created the directory strurcture like this C:VsixExtensionsgalleryExtension and moved the files down there.\nMy web.config looks like this:\n\\ \\ My Visual Studio Extensions\\ \\ \\ http://vsix/gallery/Extension/\\ \\ \\ c:VsixExtensionsgalleryExtension\\ \\ \u0026lt;/Inmeta.VSGalleryService.Properties.Settings\u0026gt;\\\nThis way it works like a charm!\nThanx again for sharing!\nSascha\nRenato Mestre — 22 May 2017\nWorked for me too! I was \u0026ldquo;fighting\u0026rdquo; with the Error 406 - Not Acceptable.\nThe solution is that: Create the same PATH. As follow\u0026gt;\nPut your files under:\nC:...\\your-web-site\\Gallery\\Extension\nPs: you can create free subfolders under \u0026ldquo;Gallery\\Extension\u0026rdquo; - Visual Studio will show them on the screen.\nTks Jakob and Sascha!\nlayos — 15 Oct 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#641292\n@Jakob \u0026ldquo;Visual Studio don\u0026rsquo;t support user authentication for galleries\u0026rdquo;.\nI tried with the \u0026ldquo;pass-through\u0026rdquo; authentication over the Basic Http with the schema user:password@hostname but it doesn\u0026rsquo;t work either. So no chances to create a \u0026ldquo;truly private\u0026rdquo; gallery?\nJakob Ehn — 18 Nov 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/11/07/using-private-extension-galleries-in-visual-studio-2012.aspx#641457\n@layos: No, unfortunately there is not.\n","permalink":"https://blog.ehn.nu/2012/11/using-private-extension-galleries-in-visual-studio-2012/","summary":"\u003cp\u003e\u003cstrong\u003eUpdated January 13th 2013\u003c/strong\u003e:  Added note about ASP.NET MVC 4.0 prerequirement\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e The installer and the complete source code is available over at CodePlex at the following location: \u003ca href=\"http://inmetavsgallery.codeplex.com\"\u003ehttp://inmetavsgallery.codeplex.com\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eExtensions and addins are everywhere in the Visual Studio ALM ecosystem! Microsoft releases new cool features in the form of extensions and the list of 3rd party extensions that plug into Visual Studio just keeps growing. One of the nice things about the VSIX extensions is how they are deployed. Microsoft hosts a public Visual Studio Gallery where you can upload extensions and make them available to the rest of the community. Visual Studio checks for updates to the installed extensions when you start Visual Studio, and installing/updating the extensions is fast since it is only a matter of extracting the files within the VSIX package to the local extension folder.\u003c/p\u003e","title":"Using Private Extension Galleries in Visual Studio 2012"},{"content":"TFS 2012 introduces a new type of Lab environment called Standard Environment. This allows you to setup a full Build Deploy Test (BDT) workflow that will build your application, deploy it to your target machine(s) and then run a set of tests on that server to verify the deployment. In TFS 2010, you had to use System Center Virtual Machine Manager and involve half of your IT department to get going. Now all you need is a server (virtual or physical) where you want to deploy and test your application. You don’t even have to install a test agent on the machine, TFS 2012 will do this for you!\nAlthough each step is rather simple, the entire process of setting it up consists of a bunch of steps. So I thought that it could be useful to run through a typical setup.I will also link to some good guidance from MSDN on each topic.\nHigh Level Steps\nInstall and configure Visual Studio 2012 Test Controller on Target Server Create Standard Environment Create Test Plan with Test Case Run Test Case Create Coded UI Test from Test Case Associate Coded UI Test with Test Case Create Build Definition using LabDefaultTemplate **\\\nInstall and Configure Visual Studio 2012 Test Controller on Target Server** First of all, note that you do not have to have the Test Controller running on the target server. It can be running on another server, as long as the Test Agent can communicate with the test controller and the test controller can communicate with the TFS server. If you have several machines in your environment (web server, database server etc..), the test controller can be installed either on one of those machines or on a dedicated machine.\nTo install the test controller, simply mount the Visual Studio Agents media on the server and browse to the vstf_controller.exe file located in the TestController folder. Run through the installation, you might need to reboot the server since it installs .NET 4.5.\nWhen the test controller is installed, the Test Controller configuration tool will launch automatically (if it doesn’t, you can start it from the Start menu). Here you will supply the credentials of the account running the test controller service. Note that this account will be given the necessary permissions in TFS during the configuration. Make sure that you have entered a valid account by pressing the Test link. Also, you have to register the test controller with the TFS collection where your test plan is located (and usually the code base of course)\nWhen you press Apply Settings, all the configuration will be done. You might get some warnings at the end, that might or might not cause a problem later. Be sure to read them carefully.\nFor more information about configuring your test controllers, see Setting Up Test Controllers and Test Agents to Manage Tests with Visual Studio\n2. Create Standard Environment\nNow you need to create a Lab environment in Microsoft Test Manager. Since we are using an existing physical or virtual machine we will create a Standard Environment.\nOpen MTM and go to Lab Center. \\ Click New to create a new environment \\ Enter a name for the environment. Since this environment will only contain one machine, we will use the machine name for the environment (TargetServer in this case) \\ On the next page, click Add to add a machine to the environment. Enter the name of the machine (TargetServer.Domain.Com), and give it the Web Server role. The name must be reachable both from your machine during configuration and from the TFS app tier server. You also need to supply an account that is a local administration on the target server. This is needed in order to automatically install a test agent later on the machine. \\ On the next page, you can add tags to the machine. This is not needed in this scenario so go to the next page. \\ Here you will specify which test controller to use and that you want to run UI tests on this environment. This will in result in a Test Agent being automatically installed and configured on the target server. The name of the machine where you installed the test controller should be available on the drop down list (TargetServer in this sample). If you can’t see it, you might have selected a different TFS project collection. \\ Press Next twice and then Verify to verify all the settings: \\ Press finish. This will now create and prepare the environment, which means that it will remote install a test agent on the machine. As part of this installation, the remote server will be restarted. \\ 3-5. Create Test Plan, Run Test Case, Create Coded UI Test\nI will not cover step 3-5 here, there are plenty of information on how you create test plans and test cases and automate them using Coded UI Tests.\nIn this example I have a test plan called My Application and it contains among other things a test suite called Automated Tests where I plan to put test cases that should be automated and executed as part of the BDT workflow.\nFor more information about Coded UI Tests, see Verifying Code by Using Coded User Interface Tests\n6. Associate Coded UI Test with Test Case\nOK, so now we want to automate our Coded UI Test and have it run as part of the BDT workflow. You might think that you coded UI test already is automated, but the meaning of the term here is that you link your coded UI Test to an existing Test Case, thereby making the Test Case automated. And the test case should be part of the test suite that we will run during the BDT.\nOpen the solution that contains the coded UI test method. \\ Open the Test Case work item that you want to automate. \\ Go to the Associated Automation tab and click on the “…” button. \\ Select the coded UI test that you corresponds to the test case: \\ Press OK and the save the test case For more information about associating an automated test case with a test case, see How to: Associate an Automated Test with a Test Case\n7. Create Build Definition using LabDefaultTemplate\nNow we are ready to create a build definition that will implement the full BDT workflow. For this purpose we will use the LabDefaultTemplate.11.xaml that comes out of the box in TFS 2012. This build process template lets you take the output of another build and deploy it to each target machine. Since the deployment process will be running on the target server, you will have less problem with permissions and firewalls than if you were to remote deploy your solution.\nSo, before creating a BDT workflow build definition, make sure that you have an existing build definition that produces a release build of your application.\nGo to the Builds hub in Team Explorer and select New Build Definition \\ Give the build definition a meaningful name, here I called it MyApplication.Deploy \\ Set the trigger to Manual \\ Define a workspace for the build definition. Note that a BDT build doesn’t really need a workspace, since all it does is to launch another build definition and deploy the output of that build. But TFS doesn’t allow you to save a build definition without adding at least one mapping. \\ On Build Defaults, select the build controller. Since this build actually won’t produce any output, you can select the “This build does not copy output files to a drop folder” option. \\ On the process tab, select the LabDefaultTemplate.11.xaml. This is usually located at $/TeamProject/BuildProcessTemplates/LabDefaultTemplate.11.xaml. To configure it, press the … button on the Lab Process Settings property \\ First, select the environment that you created before: \\ Select which build that you want to deploy and test. The “Select an existing build” option is very useful when developing the BDT workflow, because you do not have to run through the target build every time, instead it will basically just run through the deployment and test steps which speeds up the process. Here I have selected to queue a new build of the MyApplication.Test build definition \\ On the deploy tab, you need to specify how the application should be installed on the target server. You can supply a list of deployment scripts with arguments that will be executed on the target server. In this example I execute the generated web deploy command file to deploy the solution. If you for example have databases you can use sqlpackage.exe to deploy the database. If you are producing MSI installers in your build, you can run them using msiexec.exe and so on. A good practice is to create a batch file that contain the entire deployment that you can run both locally and on the target server. Then you would just execute the deployment batch file here in one single step. The workflow defines some variables that are useful when running the deployments. These variables are: **$(BuildLocation) **The full path to where your build files are located **$(InternalComputerName_) **The computer name for a virtual machine in a SCVMM environment **$(ComputerName_) **The fully qualified domain name of the virtual machine As you can see, I specify the path to the myapplication.deploy.cmd file using the $(BuildLocation) variable, which is the drop folder of the MyApplication.Test build. Note: The test agent account must have read permission in this drop location. You can find more information here on Building your Deployment Scripts \\ On the last tab, we specify which tests to run after deployment. Here I select the test plan and the Automated Tests test suite that we saw before: Note that I also selected the automated test settings (called TargetServer in this case) that I have defined for my test plan. In here I define what data that should be collected as part of the test run. For more information about test settings, see Specifying Test Settings for Microsoft Test Manager Tests We are done! Queue your BDT build and wait for it to finish. If the build succeeds, your build summary should look something like this: \\\nComments Imported from the original WordPress site. Closed for new replies.\nHassan Fadili — 06 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#618710\nThanks Ed, Great Post!\nNikhil Rajan — 07 Dec 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#622411\nDo i need to build my automation code along with my application code , inorder to do this . I need to implement the build- deploy-test workflow. I will be deploying into a virtual machine. I have prepared my coded ui scripts in visual studio and checked in the solution to source control. I have also associatd these test methods to the test cases in mtm. Now do i need to build my automation solution along with the application solution.\nJakob Ehn — 07 Dec 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#622414\n@Nikhil: Yes, you should build the automation code together with the application code. If not, you need to make sure that the build outputs the automation assemblies to the drop folder, otherwise MTM will not be able to find them when running the tests\nWade Bynum — 12 Dec 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#622607\nI\u0026rsquo;ve got two VM\u0026rsquo;s in play. First one does the build, runs the test controller and also has a test agent for build deployment. The second just has the test agent for build deployment. Builds deploy fine to the first box. My problems is deploying to the second box. I always get an \u0026ldquo;Access Denied\u0026rdquo; message in the build log for this second box. Doesn\u0026rsquo;t matter what I do. Currently I am just trying to do a directory listing on the build location. Here is my command in the deployment build:\ncmd /c dir \u0026ldquo;$(BuildLocation)\u0026rdquo;\nI get the following in the build log:\nDeployment Task Logs for Machine: XXXXXXXXX\nAccess is denied.\nException Message: Team Foundation Server could not complete the deployment task for machine \u0026lsquo;XXXXXXXXX\u0026rsquo;, script \u0026lsquo;cmd\u0026rsquo; and arguments \u0026lsquo;/c dir \u0026ldquo;\\XXXXXXXXXtfs_buildsAWS_Utilities MainAWS_Utilities Main_20121211.4\u0026rdquo;\u0026rsquo;. (type LabDeploymentProcessException)\nNote that if I run that dir command with the UNC path from a dos prompt on the second box it executes successfully without prompting for a login. I have turned off the Windows firewall on both VM\u0026rsquo;s. Both VM\u0026rsquo;s are running on the same physical machine. I have told both boxes to use the Administrator login in all places I can find. Still get the access denied. Any ideas?\nPaul Brinkley-Rogers — 11 Feb 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#624931\nWade,\nI believe that you also need a build agent installed on your second box. The deployment commands run in the context of the build agent on the target server, not the test agent. All the test agent does is a) execute tests, or b) enable the collection of test data (code coverage, ASP.Net instrumentation, etc.) on a remote machine.\nElena — 12 Apr 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#626881\nWade,\nI\u0026rsquo;m facing the same problem (\u0026ldquo;Access is denied\u0026rdquo;).\nWere you able to solve it?\n\u0026ndash; Elena\nSaravanan — 16 Apr 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#627911\nHi Jakob,\nThanks for the post. It was surprising to know that, BDT workflows cannot be triggered as a Gated-Checkin. In my project, we would like to trigger a BDT workflow as part of a gated checkin process. Is there a workaround? I could certainly think about developing a custom workflow for achieving this. I wanted to know your thoughts about solving this issue using a custom workflow?\nGary — 21 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#643084\nIs there a way to display/view such the dashboard for this type of workflow? Like in jenkins.\ngaurav — 10 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx#644686\nIs there any way where we set instructions in our build workflow to close browser once all tests are executed.\nMy tests are running on build server but brower remains open. I want something like, after my last execution, browser should get closed\nRaul — 18 Jan 2016\nI think the easiest way is defining drop down attribute to test class. i mean, if you define a method to execute one all test have been executed, there you can force to close the main driver o whatever you need. Even if referenced browser is just attached to a single test, you can always driver.quit() before test execution finishes\n","permalink":"https://blog.ehn.nu/2012/09/get-started-using-build-deploy-test-workflow-with-tfs-2012/","summary":"\u003cp\u003eTFS 2012 introduces a new type of Lab environment called Standard Environment. This allows you to setup a full Build Deploy Test (BDT) workflow that will build your application, deploy it to your target machine(s) and then run a set of tests on that server to verify the deployment. In TFS 2010, you had to use System Center Virtual Machine Manager and involve half of your IT department to get going. Now all you need is a server (virtual or physical) where you want to deploy and test your application. You don’t even have to install a test agent on the machine, TFS 2012 will do this for you!\u003c/p\u003e","title":"Get Started using Build-Deploy-Test Workflow with TFS 2012"},{"content":"Yesterday we pushed out a new release (August 2012) of the Community TFS Build Extension, including a new version of the Community TFS Build Manager (1.0.4.6)\nThe two big new features in the Build Manager in this release are: Set Triggers It is now possible to select one or more build definitions and update the triggers for them in one simple operation: \\\nYou’ll note that we have started collapsing the context menu a bit, the list of commands are getting long! 🙂\nWhen selecting the Trigger command, you’ll see a dialog where the options should be self-explanatory: \\\nThe only thing missing here is the Scheduled trigger option, you’ll have to do that using Team Explorer for now.\nManage Build Resources The other feature is that it is now possible to view the build controllers and agents in your current collection and also perform some actions against them. The new functionality is available by select the Build Resources item in the drop down menu: \\\nSelecting this, you’ll see a (sort of) hierarchical view of the build controllers and their agents:\nIn this view you can quickly see all the resources and their status. You can also view the build directory of each build agent and the tags that are associated with them. On the action menu, you can enable and disable both agents and controllers (several at a time), and you can also select to remove them. By selecting Manage, you’ll be presented with the standard Manage Controller dialog from Visual Studio where you can set the rest of the properties. Hopefully we’ll be able to implement most of the existing functionality so that we can remove that menu option 🙂 Our plan is to add more functionality to this view, such as adding new agents/controllers, restarting build service hosts, maybe view diagnostic information such as disk space and error logs.\nHope you’ll find the new functionality useful. Remember to log any bugs and feature requests on the CodePlex site.\nHappy building!\n","permalink":"https://blog.ehn.nu/2012/08/new-functionality-in-tfs-build-manager-managing-triggers-and-build-resources/","summary":"\u003cp\u003eYesterday we pushed out a new release (August 2012) of the \u003ca href=\"http://tfsbuildextensions.codeplex.com/\"\u003eCommunity TFS Build Extension\u003c/a\u003e, including a new version of the \u003ca href=\"http://visualstudiogallery.msdn.microsoft.com/cfdb84b4-285e-4eeb-9fa9-dad9bfe2cd10\"\u003eCommunity TFS Build Manager\u003c/a\u003e (1.0.4.6)\u003c/p\u003e\n\u003cp\u003eThe two big new features in the Build Manager in this release are: \u003cbr\u003e\n\u003cstrong\u003eSet Triggers\u003c/strong\u003e \u003cbr\u003e\nIt is now possible to select one or more build definitions and update the triggers for them in one simple operation: \\\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://gwb.blob.core.windows.net/jakob/Windows-Live-Writer/TFS-Build-Manager_A019/image_2.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2012/08/new-functionality-in-tfs-build-manager-managing-triggers-and-build-resources/19_image_thumb.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eYou’ll note that we have started collapsing the context menu a bit, the list of commands are getting long! 🙂\u003c/p\u003e","title":"New functionality in TFS Build Manager – Managing Triggers and Build Resources"},{"content":"During the spring/summer I have been involved with reviewing a new book about Visual Studio 2012 ALM from Apress called “Pro Application Lifecycle Management with Visual Studio 2012”\nThe book is written by a fellow Visual Studio ALM MVP Mathias Olausson and his colleague Joachim Rossberg. It is a very comprehensive book that covers both all aspects of ALM in general and also how to implement these practices with Visual Studio 2012. The book also has several chapters dedicated to measuring your improvements by using ALM assessments and metrics.\nRead more about the book here on Mathias blog: http://msmvps.com/blogs/molausson/archive/2012/07/17/book-project-pro-application-lifecycle-management-with-visual-studio-2012-completed.aspx\nYou can pre-order the book here at Amazon: http://www.amazon.com/Application-Lifecycle-Management-Visual-Professional/dp/1430243449/\nCheck it out! 🙂\n","permalink":"https://blog.ehn.nu/2012/08/new-vs2012-book-pro-application-lifecycle-management-with-visual-studio-2012/","summary":"\u003cp\u003eDuring the spring/summer I have been involved with reviewing a new book about Visual Studio 2012 ALM from Apress called “Pro Application Lifecycle Management with Visual Studio 2012”\u003c/p\u003e\n\u003cp\u003eThe book is written by a fellow Visual Studio ALM MVP \u003ca href=\"http://msmvps.com/blogs/molausson/default.aspx\"\u003eMathias Olausson\u003c/a\u003e and his colleague Joachim Rossberg. It is a very comprehensive book that covers both all aspects of ALM in general and also how to implement these practices with Visual Studio 2012. The book also has several chapters dedicated to measuring your improvements by using ALM assessments and metrics.\u003c/p\u003e","title":"New VS2012 Book: Pro Application Lifecycle Management with Visual Studio 2012"},{"content":"Together with todays announcement that Visual Studio 2012 as been officially released, the ALM Rangers have also simultaneously shipped (“sim-shipped”) a massive set of solutions for feature gaps and value-add guidance for the ALM community.\nhttp://blogs.msdn.com/b/visualstudioalm/archive/2012/08/15/welcome-to-visual-studio-2012-alm-rangers-readiness-wave.aspx\nYou can find a complete list of ALM Ranger solutions here: http://msdn.microsoft.com/en-us/vstudio/ee358787\nI have been a part of the Team Foundation Build Customization Guide, which have been updated with new features in Visual Studio 2012, as well as the top requested features from the first version of the guidance. As part of this guidance, we have also developed the Community TFS Build Manager, a Visual Studio extension that simplifies a lot of tasks when working with TFS Build. It now exist both for Visual Studio 2012 as well as for Visual Studio 2010. I’d like to thank the rest of the team for doing such a great job, especially Mike Fourie who has been driving the entire project in style!\nI am proud to be a part of the ALM Rangers group, everybody involved put in a considerable amount of their (already limited) spare time to produce top quality guidance and tools for the community.\n","permalink":"https://blog.ehn.nu/2012/08/alm-rangers-readiness-gig-has-shipped/","summary":"\u003cp\u003eTogether with todays announcement that Visual Studio 2012 as been officially released, the ALM Rangers have also simultaneously shipped (“sim-shipped”) a massive set of solutions for feature gaps and value-add guidance for the ALM community.\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://blogs.msdn.com/b/visualstudioalm/archive/2012/08/15/welcome-to-visual-studio-2012-alm-rangers-readiness-wave.aspx\" title=\"http://blogs.msdn.com/b/visualstudioalm/archive/2012/08/15/welcome-to-visual-studio-2012-alm-rangers-readiness-wave.aspx\"\u003ehttp://blogs.msdn.com/b/visualstudioalm/archive/2012/08/15/welcome-to-visual-studio-2012-alm-rangers-readiness-wave.aspx\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eYou can find a complete list of ALM Ranger solutions here: \u003cbr\u003e\n\u003ca href=\"http://msdn.microsoft.com/en-us/vstudio/ee358787\" title=\"http://msdn.microsoft.com/en-us/vstudio/ee358787\"\u003ehttp://msdn.microsoft.com/en-us/vstudio/ee358787\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eI have been a part of the \u003ca href=\"http://vsarbuildguide.codeplex.com/\"\u003eTeam Foundation Build Customization Guide\u003c/a\u003e, which have been updated with new features in Visual Studio 2012, as well as the top requested features from the first version of the guidance. As part of this guidance, we have also developed the Community TFS Build Manager, a Visual Studio extension that simplifies a lot of tasks when working with TFS Build. It now exist both for \u003ca href=\"http://visualstudiogallery.msdn.microsoft.com/cfdb84b4-285e-4eeb-9fa9-dad9bfe2cd10\"\u003eVisual Studio 2012\u003c/a\u003e as well as for \u003ca href=\"http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c\"\u003eVisual Studio 2010\u003c/a\u003e. I’d like to thank the rest of the team for doing such a great job, especially \u003ca href=\"http://www.freetodev.com/\"\u003eMike Fourie\u003c/a\u003e who has been driving the entire project in style!\u003c/p\u003e","title":"ALM Rangers Readiness GIG has shipped!"},{"content":"\nI have posted before on how to implement dependency replication using TFS Build, once for TFS 2008 using MSBuild and then for TFS 2010 using Windows Workflow. The last post was not complete (I could not post all implementation details back then for various reasons), so I decided that I should post a new solution for this, but this time using the Community TFS Build Extensions library.\nIf it is a good idea to store your dependencies in source control or not is a question that is well debated. I’m not going to argue pros and cons here, but for those of you that want to go this way here is a build process template that will get you started.\nAn interesting fact is that Microsoft actually have added this feature as part of the hosted TFS (TFS Services) running on Windows Azure, but decided post-Beta that this feature was not to be included in the on-premise version of TFS. The feature might reappear in the on-premise version at some point in the future but nothing is confirmed yet. For hosted TFS, this feature is a must since users would not be able to access the network shares that TFS Build normally use as drop location.\nFeatures of the DependencyReplication.xaml build process template I have added a new Build Process template called DependencyReplication.xaml to the TFS Build Extensions that performs the following steps, in addition to the common default template:\nAccepts a source control folder input parameter where the binaries should be stored (DeployFolder) \\ Versions all assemblies, using the TfsVersion activity \\ Copies to binaries to the the deploy folder \\ Check in the binaries. The check-in comment includes the version number (using the TfsSource activity) \\ If any errors occurs as part of the replication, it will undo any pending changes as part of the build I have uploaded the build process template to the CodePlex site, so it is available at $/teambuild2010contrib/CustomActivities/MAIN/Source/BuildProcessTemplates/DependencyReplication.xaml. Note: The build process template uses the latest version of the activities, so make sure that you download the latest source and compile it. I had to make some additions to the library to support the functionality of the build process template. The changes will be included in the next official release, but until then you must download the latest bits and build it yourself.\nHow to use the Build Process Template\nAdd the DependencyReplication.xaml file to source control. You can add it wherever you like. This sample assumes that you add it to *$/Demo/BuildProcessTemplates/ * Make sure that you have added the necessary TFSBuildExtension assemblies to the Version Control path for Custom assemblies. See this link for how to do this. Since this template only uses a few of the build activities, you only need to add the following assemblies: \\ TfsBuildExtensions.Activites.dll \\ TfsBuildExtensions.TfsUtilities.dll \\ Ionic.Zip.dll \\ Create a new build definition. \\ In the process tab, click the Show Details button \\ Click New and then the Select an existing XAML file radio button and browse to the DependencyReplication.xaml file that you just added: \\ Note that you will now have an additional, required, process parameter called DeployFolder, located in the Misc category. Enter the source control folder path where you want the binaries to be stored. Note: This path must exist in source control, and must also be a part of the workspace for the current build definition otherwise the build will fail. This is a limitation of the current implementation. It can be implemented by modifying the workspace at build time, as I did in my first post on dependency replication. \\ You must also change the Build Number Format parameter to be $(BuildDefinitionName)_1.0.0$(Rev:.r) Note: This build process template uses the built-in functionality for incrementing the build number, so the version number will be a part of the build number itself which gives you a nice traceability between the build and the generated assemblies. It then parses the version number from the Build number, so you need to have the four-part version number as part of the build number format. If you have some other way of managing version numbers, you will need to change the build process template correspondingly. The 1.0.0 part above can obviously have any value, it will represent your Major.Minor.Revision part of the generated version number. \\ Save the build definition and queue a build After the build has finished, you should see that the binaries have been added to source control in the given path. Note that all files in the binaries folder will be added to source control. If this is not what you want, you need to modify the build process template. An option here would be to add the filter expression (.) as a process parameter to make it configurable per build definition. If you download the binaries you should see that they have the same version number that was included in the build number for that particular build. If you view history of the folder, you will see that the build service account (in my case the Network service) have checked in the files with a comment containing the version number: \\\nIf you have check-in policies enabled for the team project, they will be overridden as part of the check-in with a comment.\nI hope that you will find this build process template useful. It is by no means a full solution, it lacks some error checking and also it should handle the case where the DeployFolder path is outside the workspace for the build definition. Let me know if you really need this feature and I will consider adding it to the template 🙂. Of course, you can add it yourself and post it back to the community.\nComments Imported from the original WordPress site. Closed for new replies.\nJonathan — 30 Jul 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/15/tfs-build-dependency-replication-using-community-tfs-build-extensions.aspx#617170\nI can\u0026rsquo;t get it to work when I download from CodePlex. I get the following error in my Build:\nTF215097: An error occurred while initializing a build for build definition STRFrameworkSTR Framework Library Build: Cannot set unknown member \u0026lsquo;Microsoft.TeamFoundation.Build.Workflow.Activities.MSBuild.AllowUntrustedCertificate\u0026rsquo;.\nDerek M — 31 Jul 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/15/tfs-build-dependency-replication-using-community-tfs-build-extensions.aspx#617250\nThanks for the update to the Dependency topic.\nI think I followed your instructions, but I am wondering if the template (DependencyReplication.xaml) is built for TFS2012 or 2010? I am seeing a bunch of items that can\u0026rsquo;t find references and I think that may be it.\nThanks!\nJakob Ehn — 10 Aug 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/15/tfs-build-dependency-replication-using-community-tfs-build-extensions.aspx#617703\n@Derek: The template is built for TFS2012. The custom activities however exist for both TFS2010 and TFS2012 so you should be able to convert it pretty easily\nsamaa tv — 08 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/15/tfs-build-dependency-replication-using-community-tfs-build-extensions.aspx#618805\nGood work! I always like to leave comments whenever I see something unusual or impressive. I think we must appreciate those who do something especial. Keep it up, thanks\nJosephJ — 16 Apr 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/15/tfs-build-dependency-replication-using-community-tfs-build-extensions.aspx#627937\nIf the folder is part of the workspace how do you keep the check in from triggering another build? We are doing this, and currently have to cloak the folder in the current workspace.\nJakob Ehn — 17 Apr 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/15/tfs-build-dependency-replication-using-community-tfs-build-extensions.aspx#627944\n@Joseph: As you can see on the last screenshot of the post, the checkin is done with the string NO_CI in the comment. This will cause TFS to not trigger new CI builds.\nThanks\n/Jakob\nNathan — 09 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/15/tfs-build-dependency-replication-using-community-tfs-build-extensions.aspx#642885\nThank you for this. I do have one question. How well does this work with a Java project? We are trying to have a Java package build, via ANT/build.xml, on the TFS server, and then move the build output(.jar file) to the staging area. Is there any issues that you can think of that would prevent this solution/template from working with a Java package?\nThanks for all of the info you\u0026rsquo;ve provided, this is very helpful.\n","permalink":"https://blog.ehn.nu/2012/07/tfs-build-dependency-replication-using-community-tfs-build-extensions/","summary":"\u003cp\u003e\u003cbr\u003e\nI have posted before on how to implement dependency replication using TFS Build, \u003ca href=\"http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx\"\u003eonce for TFS 2008 using MSBuild\u003c/a\u003e and then for \u003ca href=\"http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx\"\u003eTFS 2010 using Windows Workflow\u003c/a\u003e. The last post was not complete (I could not post all implementation details back then for various reasons), so I decided that I should post a new solution for this, but this time using the \u003ca href=\"http://tfsbuildextensions.codeplex.com/\"\u003eCommunity TFS Build Extensions\u003c/a\u003e library.\u003c/p\u003e\n\u003cp\u003eIf it is a good idea to store your dependencies in source control or not is a question that is well debated. I’m not going to argue pros and cons here, but for those of you that want to go this way here is a build process template that will get you started.\u003c/p\u003e","title":"TFS Build: Dependency Replication using Community TFS Build Extensions"},{"content":"I finally got around to push out a version of the Community TFS Build Manager that is compatible with Visual Studio 2012 RC. Unfortunately I had to do this as a separate extension, it references different versions of the TFS assemblies and also some properties and methods that the 2010 version uses are now obsolete in the TFS 2012 API.\nTo download it, just open the Extension Manager, select Online and search for TFS Build:\nYou can also download it from this link: http://visualstudiogallery.msdn.microsoft.com/cfdb84b4-285e-4eeb-9fa9-dad9bfe2cd10\nThe functionality is identical to the 2010 version, the only difference is that you can’t start it from the Team Explorer Builds node (since the TE has been completely rewritten and the extension API’s are not yet published). So, to start it you must use the Tools menu:\nWe will continue shipping updates to both versions in the future, as long as it functionality that is compatible with both TFS 2010 and TFS 2012.\nYou might also note that the color scheme used for the build manager doesn’t look as good with the VS2012 theme….\nHope you will enjoy the tool in Visual Studio 2012 as well. I want to thank all the people who have downloaded and used the 2010 version! For feedback, feature requests, bug reports please post this to the CodePlex site: http://tfsbuildextensions.codeplex.com\nComments Imported from the original WordPress site. Closed for new replies.\nsamaa tv — 08 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/07/02/community-tfs-build-manager-available-for-visual-studio-2012-rc.aspx#618811\nI think we must appreciate those who do something especial. Keep it up, thanks\\\n","permalink":"https://blog.ehn.nu/2012/07/community-tfs-build-manager-available-for-visual-studio-2012-rc/","summary":"\u003cp\u003eI finally got around to push out a version of the Community TFS Build Manager that is compatible with Visual Studio 2012 RC. Unfortunately I had to do this as a separate extension, \u003cbr\u003e\nit references different versions of the TFS assemblies and also some properties and methods that the 2010 version uses are now obsolete in the TFS 2012 API.\u003c/p\u003e\n\u003cp\u003eTo download it, just open the Extension Manager, select Online and search for TFS Build:\u003c/p\u003e","title":"Community TFS Build Manager available for Visual Studio 2012 RC"},{"content":"As many of you probably have noticed by now, Visual Studio Database Projects are not supported in the next version of Visual Studio (currently named Visual Studio 11 Beta). When you open a solution containing a VSDB project, VS11 wants to convert it to a SQL Server Developer Tools project instead.\nThis project type ships with SQL Server and has a feature set that covers most of the functionality of the VSDB project, plus some new features, such a support for SQL 2012 and SQL Azure. A feature comparison list between the two project types can be found here: http://blogs.msdn.com/b/ssdt/archive/2011/11/21/sql-server-data-tools-ctp4-vs-vs2010-database-projects.aspx\nOnce you have converted your project to a SSDT project, you will find that most of the functionality is very similar to VSDB, how you work with schema objects, schema comparisons etc. Deploying a SSDT project is called Publish and is available in the Visual Studio context menu: \\\nWhen you invoke the Publish command, Visual Studio will launch the Publish Profile dialog, where you can configure how and where you want to deploy the database: \\\nThere are lots of options that you can configure, and these options are often different depending on the target environment. For example, locally you typically want to recreate the database every time you deploy, but when deploying to a test server, you probably only want to update it incrementally without removing any existing data. The settings that you enter can be stored in a separate profile file, which you will use when you are deploying the database.\nSo, create a publish profile for each environment that you want to deploy to. In the following example, I have one profile for deploying to my local machine, and in addition publish profiles for the test and production environments:\n(Note that you can right-click a publish profile and mark it as default. This is the profile that will be chosen when you select Publish in Visual Studio, so in this case I would select Local.publish.xml) The Publish command calls the Publish MSBuild target which will eventually call the SqlPublishTask MSBuild task which will do the work of deploying your database. This means that the deployment of the database project is easy to integrate into TFS Build, since you can just specify that you want to invoke the Publish target as part of your build: \\\nHere, I have chosen to deploy the database using the Test profile, which would typically by a remote server used for testing of the build.\n**Using SQLCMD variables **Sometimes you need to use parameters in your scripts, e.g. values that you can pass in dynamically when the script is executed. These are called SQLCMD variables, and you can define these on the properties page of the database project:\nHere I have defined a variable called $(TargetServer), and given it a default value of localhost. Then I have references this variable inside a post deployment script in side the project, like this:\nEXEC master..xp_cmdshell \u0026#39;bcp Daatabase.[dbo].[Table] in \u0026#34;TableContent.dat\u0026#34; -T -c -S$(TargetServer)\u0026#39; This is a scenario we had at a client recently, where they used the BCP utility to bulk insert lots of data into a few tables as part of the deployment. To be able to run BCP against different target servers (dev, test etc) in my build, I used the SQLCMD variable.\nWhen you publish your database from Visual Studio, it will prompt you to give the variables a value. But when deploying from a build, the value need to be set per configuration. This is done by opening the publish profile file for the target environment and store that value there:\nSelect “Save Profile As” and save it as your target publish profile. Since we are specifying our publish profile in our build definition, it will populate the variables with the correct values.\nComments Imported from the original WordPress site. Closed for new replies.\nGary Stafford — 13 Aug 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#617802\nGreat article. Hard to find good coverage of SSDT and build strategies.\nHamid — 19 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#619200\nGreat article. How would you suggest to maintain publish files when you have a number of similar environments, for instance 4 test rigs or a pre-prod environment similar to that of production?\nHydTechie — 21 May 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#628823\nKindly update this article for incremental updations to Test server, you mentioned it in text but i could not found any steps associated to it,\nthanks\nHydTechie\nsoso — 02 Jul 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#630530\nHi, how do you handle the incremental updates of test database? i didnt find out.\nBalázs Máté — 30 Oct 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#633166\nHi, thanks a lot for this article.\nJordan — 26 Nov 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#633920\nI\u0026rsquo;ve been using publish profiles, and SQL publish profiles for a while. But recently have been struggling automating the DB publish. Of course, right clicking on my publish profiles works correctly, and runs as expected, but automating through TFS Build 2012 seems not to update anything, even when I match your parameters - any pointers?\nI have a very simple CI system, which works flawlessly for our 20 or so web services. DB portion is troublesome\u0026hellip;\nJakob Ehn — 26 Nov 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#633925\n@Jordan: Hard to tell, are you sure that the SqlPublishProfilePath parameter matches an existing file?\nJustin — 17 Jan 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#635062\nIs this possible when your build targets a solution with multiple projects? I would like to build my application as well as deploy my database changes\nMr Singh — 13 May 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/25/deploying-ssdt-projects-with-tfs-build.aspx#637652\nGreat Article, thanks heaps\n","permalink":"https://blog.ehn.nu/2012/04/deploying-ssdt-projects-with-tfs-build/","summary":"\u003cp\u003eAs many of you probably have noticed by now, \u003ca href=\"http://msdn.microsoft.com/en-us/library/xee70aty.aspx\"\u003eVisual Studio Database Projects\u003c/a\u003e are not supported in the next version of Visual Studio (currently named \u003cbr\u003e\nVisual Studio 11 Beta). When you open a solution containing a VSDB project, VS11 wants to convert it to a \u003ca href=\"http://msdn.microsoft.com/en-us/magazine/hh394146.aspx\"\u003eSQL Server Developer Tools\u003c/a\u003e project instead.\u003c/p\u003e\n\u003cp\u003eThis project type ships with SQL Server and has a feature set that covers most of the functionality of the VSDB project, plus some new features, such \u003cbr\u003e\na support for SQL 2012 and SQL Azure. A feature comparison list between the two project types can be found here: \u003cbr\u003e\n\u003ca href=\"http://blogs.msdn.com/b/ssdt/archive/2011/11/21/sql-server-data-tools-ctp4-vs-vs2010-database-projects.aspx\" title=\"http://blogs.msdn.com/b/ssdt/archive/2011/11/21/sql-server-data-tools-ctp4-vs-vs2010-database-projects.aspx\"\u003ehttp://blogs.msdn.com/b/ssdt/archive/2011/11/21/sql-server-data-tools-ctp4-vs-vs2010-database-projects.aspx\u003c/a\u003e\u003c/p\u003e","title":"Deploying SSDT Projects with TFS Build"},{"content":"Today I received an email from Microsoft stating that:\nDear Jakob Ehn, Congratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual Studio ALM technical communities during the past year.\nThis is incredibles news and I really want to thank both the people at Microsoft who nominated me and some of the (now) fellow MVP’s that I have worked with over the last year, both as part of the Visual Studio ALM Rangers program and as part of the TFS Build Extensions community project, in particular Mike Fourie and of course my colleague and main source of inspiration Terje Sandström 🙂\nI’m really looking forward to this year, it’s going to be a blast! 🙂\nComments Imported from the original WordPress site. Closed for new replies.\nMike Fourie — 01 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/01/awarded-visual-studio-alm-mvp-for-2012.aspx#611285\nWell deserved and about time!\nCongratulations! Mike\nJahangeer — 02 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/01/awarded-visual-studio-alm-mvp-for-2012.aspx#611290\nCongratulations Jakob!!\nTommy Sundling — 02 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/01/awarded-visual-studio-alm-mvp-for-2012.aspx#611328\nCongratulations, well done!\nRichard | braces for adults — 04 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/01/awarded-visual-studio-alm-mvp-for-2012.aspx#611383\nCongratulations, I never thought that there’s award like this. Thanks to those who are willing to share their knowledge keep on sharing.\nAbraham — 29 Jun 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/04/01/awarded-visual-studio-alm-mvp-for-2012.aspx#615754\nyou deserve it :)\\\n","permalink":"https://blog.ehn.nu/2012/04/awarded-visual-studio-alm-mvp-for-2012/","summary":"\u003cp\u003eToday I received an email from Microsoft stating that:\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eDear Jakob Ehn, \u003cbr\u003e\nCongratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! \u003cbr\u003e\nThis award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. \u003cbr\u003e\nWe appreciate your outstanding contributions in Visual Studio ALM technical communities during the past year.\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eThis is incredibles news and I really want to thank both the people at Microsoft who nominated me and some of the (now) fellow MVP’s that I have worked with over the last year, both as part of the Visual Studio ALM Rangers program and as part of the TFS Build Extensions community project, in particular \u003ca href=\"http://mikefourie.wordpress.com/\"\u003eMike Fourie\u003c/a\u003e and of course my colleague and main source of inspiration \u003ca href=\"http://geekswithblogs.net/terje/Default.aspx\"\u003eTerje Sandström\u003c/a\u003e 🙂\u003c/p\u003e","title":"Awarded Visual Studio ALM MVP for 2012!"},{"content":"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 ParallelTemplate.xaml template 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.\nBut since we aren’t using MSBuild we don’t the get nice configuration summary section on the build summary page that we are used to. We would like to show the result of each configuration with any errors/warnings as usual, together with a link to the log file.\nTFS 2010 API to the rescue! What we need to do is adding information to the InformationNode structure that is associated with every TFS build. The log that you normally see in the Log view is built up as a tree structure of IBuildInformationNode objects. This structure can we accessed by using the InformationNodeConverters class. This class also contain some helper methods for creating BuildProjectNode, which contain the information about each project that was build, for example which configuration, number of errors and warnings and link to the log file.\nHere is a code snippet that first creates a “fake” build from scratch and the add two BuildProjectNodes, one for Debug|x86 and one for Release|x86 with some release information:\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ TfsTeamProjectCollection collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(\u0026#34;http://lt-jakob2010:8080/tfs\u0026#34;)); IBuildServer buildServer = collection.GetService\u0026lt;IBuildServer\u0026gt;(); var buildDef = buildServer.GetBuildDefinition(\u0026#34;TeamProject\u0026#34;, \u0026#34;BuildDefinition\u0026#34;); //Create fake build with random build number var detail = buildDef.CreateManualBuild(new Random().Next().ToString()); // Create Debug|x86 project summary IBuildProjectNode buildProjectNode = detail.Information.AddBuildProjectNode(DateTime.Now, \u0026#34;Debug\u0026#34;, \u0026#34;MySolution.sln\u0026#34;, \u0026#34;x86\u0026#34;, \u0026#34;$/project/MySolution.sln\u0026#34;, DateTime.Now, \u0026#34;Default\u0026#34;); buildProjectNode.CompilationErrors = 1; buildProjectNode.CompilationWarnings = 1; buildProjectNode.Node.Children.AddBuildError(\u0026#34;Compilation\u0026#34;, \u0026#34;File1.cs\u0026#34;, 12, 5, \u0026#34;\u0026#34;, \u0026#34;Syntax error\u0026#34;, DateTime.Now); buildProjectNode.Node.Children.AddBuildWarning(\u0026#34;File2.cs\u0026#34;, 3, 1, \u0026#34;\u0026#34;, \u0026#34;Some warning\u0026#34;, DateTime.Now, \u0026#34;Compilation\u0026#34;); buildProjectNode.Node.Children.AddExternalLink(\u0026#34;Log File\u0026#34;, new Uri(@\u0026#34;\\serversharelogfiledebug.txt\u0026#34;)); buildProjectNode.Save(); // Create Releaes|x86 project summary buildProjectNode = detail.Information.AddBuildProjectNode(DateTime.Now, \u0026#34;Release\u0026#34;, \u0026#34;MySolution.sln\u0026#34;, \u0026#34;x86\u0026#34;, \u0026#34;$/project/MySolution.sln\u0026#34;, DateTime.Now, \u0026#34;Default\u0026#34;); buildProjectNode.CompilationErrors = 0; buildProjectNode.CompilationWarnings = 0; buildProjectNode.Node.Children.AddExternalLink(\u0026#34;Log File\u0026#34;, new Uri(@\u0026#34;\\serversharelogfilerelease.txt\u0026#34;)); buildProjectNode.Save(); detail.Information.Save(); detail.FinalizeStatus(BuildStatus.Failed); When running this code, it will a create a build that looks like this:\nAs you can see, it created two configurations with error and warning information and a link to a log file. Just like a regular MSBuild would have done.\nThis is very useful when using TFS 2010 Build in heterogeneous environments. It would also be possible to do this when running compilations completely outside TFS build, but then push the results of the into TFS for easy access. You can push all information, including the compilation summary, drop location, test results etc using the API.\nComments Imported from the original WordPress site. Closed for new replies.\nVictor — 31 Jul 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/03/30/adding-fake-build-information-in-tfs-2010.aspx#639209\nHi, i have been looking for that template do you by chance have a copy of it, i can\u0026rsquo;t find it on the blog link. Thanks\n","permalink":"https://blog.ehn.nu/2012/03/adding-fake-build-information-in-tfs-2010/","summary":"\u003cp\u003eWe 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 \u003ca href=\"http://blogs.msdn.com/b/jimlamb/archive/2010/09/14/parallelized-builds-with-tfs2010.aspx\"\u003eParallelTemplate.xaml template\u003c/a\u003e 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.\u003c/p\u003e","title":"Adding Fake Build Information in TFS 2010"},{"content":"A year ago I blogged about how to manage your build process templates using the TFS API. 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.\nHowever, by having the build process templates in a single location, the users must know where the build process templates are located and browse to that path and add it to the team project, before it will show up in the list of build process templates: \\\nUnfortunately, you can’t manage the build process templates this way using Team Explorer, you have to resort to the TFS API to do these things.\nUntil now! 🙂 In the latest release of the Community TFS Build Manager I have added support for managing build process templates.\nThe templates are accessible by selecting “Build Process Templates” in the “Show” dropdown: \\\nThis will show all registered build process templates, either in the selected team project or in all team projects, depending on your current filter: \\\nAll build process templates in the XDemo team project. The grid is of course sortable as the rest of the application. This lets you easily see where the template is registered.\nNote that several of the build process templates in the list above is stored in the Inmeta team project, which is our team project for storing all artifacts related to our software factory, including the build process templates and custom activities.\nNow, we can right click on a build process template and perform any of the following actions: \\\nSet As Default This will set the selected build process template as the default build process template in the corresponding team project. There can only be one default build process template per team project, so the tool will automatically scan for any other default build process templates and set them back to “Custom”. \\ Add to Team Project(s) This will let you select one or more team projects where you want to add this build process template to: In the list you can select one or more team projects. You can also specify that the template(s) should be set as default by using the checkbox “Set as Default”. \\ **Remove from Team Project(s) **This does the opposite from the previous operation, it removes the selected build process template(s) from one or more team project. After this operation, the template will not be visible in the “Build Process file” dropdown when editing a build process template. Note: When removing a build process template, there might be build definitions using this template. If this is the case, the build manager will prompt you with a dialog before you proceed with the remove: Hope that you find the new functionality useful. Please report bugs and feature requests to the Community TFS Build Extensions CodePlex site\nComments Imported from the original WordPress site. Closed for new replies.\ndunya tv — 08 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/02/21/managing-build-templates-with-community-tfs-build-manager.aspx#618807\nI thought I would leave my first comment but I don\u0026rsquo;t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.THANKS.\\\n","permalink":"https://blog.ehn.nu/2012/02/managing-build-templates-with-community-tfs-build-manager/","summary":"\u003cp\u003eA year ago I blogged about how to \u003ca href=\"http://geekswithblogs.net/jakob/archive/2010/11/03/managing-build-process-templates-in-tfs-2010-build.aspx\"\u003emanage your build process templates using the TFS API\u003c/a\u003e. 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.\u003c/p\u003e","title":"Managing Build Templates with Community TFS Build Manager"},{"content":"\nThe InvokeProcess activity is very useful when it comes to running shell commands and external command line tools during a build process. When it comes to integrating with TFS source control during a build, the TF.exe command line tool can be your friend, as it lets you do most of the usual stuff such as check-in, checkout, add, modify workspaces etc.\nHowever, it can be a bit tricky to handle the output from tf.exe, since it often produces warnings that is not necessarily a problem for your build. This is not a problem related only to tf.exe, but to all applications that produces errors and warnings on the canonical error format.\nThe normal way to use the InvokeProcess activity is to setup the necessary parameters to call the tool with the correct path, working directory and command line switches. Then you add a WriteBuildMessage activity to the Handle Standard Output action handler and a WriteBuildError to the Handle Error Output action handler. In addition, you store the Result output property from the InvokeProcess activity in a workflow variable that you can evaluate after the InvokeProcess activity has finished.\nThis will output all standard output from the application to the build log, and all errors will be written as errors to the build log and will partially fail the build. If you try this with TF.exe you will probably notice a problem with warnings from the tool being reported as errors in the build, causing it to partially fail the build, even though the ReturnCode was zero. To solve this problem you need to collect the information that is passed to the Error Output action handler. Note that this handler is called several times so you need to handle formatting of the output in some way. Then, you check the ReturnCode from the InvokeProcess activity and in case this is \u0026lt;\u0026gt; 0, you write the collection information as an error to the build log (using WriteBuildError) and then throw an exception. Otherwise, just write the information to the build log using WriteBuildMessage, so you get all information out there.\nThe finished sample looks like this: \\\nIn the \u0026ldquo;Check out files” sequence I have defined a workflow variable called ErrorOutputFromTF of type string. In the “Handle Error Output” handler, I append the error to this variable, using the Assign activity: \\\nI just append a newline character at the end to have all the errors on separate rows in the build log later. After the InvokeProcess activity I check the TFExitCode variable, that was assigned the ResultCode value from the InvokeProcess activity previously, if it is \u0026lt;\u0026gt; 0 I write the ErrorOutputFromTF to the build error log and then I throw an exception.\nHere is a sample build log output:\nNote that tf.exe in this case outputs information about check-in policies that have been overridden. This is an example of information that would cause the build to partially fail, but is now logged as information.\nComments Imported from the original WordPress site. Closed for new replies.\ndunya tv — 08 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/02/01/handling-warnings-and-errors-with-invokeprocess-in-tfs-2010-build.aspx#618806\nI just came across your blog and reading your beautiful words. I thought I would leave my first comment but I don\u0026rsquo;t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.\nsudhakar — 03 Jan 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/02/01/handling-warnings-and-errors-with-invokeprocess-in-tfs-2010-build.aspx#623352\nHi,\nCan you let me know how the TFExitCode variable is assigned from th \u0026lsquo;Result\u0026rsquo; property of the InvokeProcess?\nI am looking for this and am urgent. Please clarify.\nThanks,\nDiego Spinella — 19 Aug 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/02/01/handling-warnings-and-errors-with-invokeprocess-in-tfs-2010-build.aspx#645881\nHi! Congratulations for the post. Let me ask you, would you know how to put the log in the summary?\nI need a piece of writing for summary.\nThx!\nSry for my english.\nVictoria — 10 Sep 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2012/02/01/handling-warnings-and-errors-with-invokeprocess-in-tfs-2010-build.aspx#646139\nThank you, this was very useful! @sudhakar: To assign to TFExitCode variable, select your InvokeProcess activity in Visual Studio, then hit F4 to see its properties. Set the value of \u0026lsquo;Result\u0026rsquo; property to \u0026ldquo;TFExitCode\u0026rdquo; (without quotes).\nFor other kinds of assignments, use Assign activity, as mentioned in the article.\nAajaamu — 13 Jul 2016\nHi Jakob,\ni am not sure why but \u0026ldquo;WriteBuildError\u0026rdquo; activity only when included in TFExitCode0, through below error \u0026ldquo;erroutput is not declared. It may be inaccessible due to its protection level\u0026rdquo;\nIf i invoke the same activity somewhere else i don\u0026rsquo;t see any issues.\nPlease let me know if you need more details\n","permalink":"https://blog.ehn.nu/2012/02/handling-warnings-and-errors-with-invokeprocess-in-tfs-2010-build/","summary":"\u003cp\u003e\u003cbr\u003e\nThe \u003ca href=\"http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.build.workflow.activities.invokeprocess.aspx\"\u003eInvokeProcess activity\u003c/a\u003e is very useful when it comes to running shell commands and external command line tools during a build process. When it comes to integrating with TFS source control during a build, the TF.exe command line tool can be your friend, as it lets you do most of the usual stuff such as check-in, checkout, add, modify workspaces etc.\u003c/p\u003e\n\u003cp\u003eHowever, it can be a bit tricky to handle the output from tf.exe, since it often produces warnings that is not necessarily a problem for your build. This is not a problem related only to tf.exe, but to all applications that produces errors and warnings on the canonical error format.\u003c/p\u003e","title":"Handling Warnings and Errors with InvokeProcess in TFS 2010 Build"},{"content":"I’ll be running a Team Foundation Server 2010 Deep Dive class twice this spring in Stockholm at our friends at Cornerstone.\nThe class is 4 days and we will be “diving deep” into all aspects of TFS 2010, including:\nDeployment\nAdministration\nSource Control\nCheck-in Policies\nBranching strategies\nWork Items\nOffice integration\nReporting\nCustomization\nTeam Build\nWorking with build definitions\nDeveloping Custom Activities\nAutomatic deployment\nTest Management\nMicrosoft Test Manager\nCreating and running manual tests\nAutomating manual tests/Coded UI Tests\nTFS/VS Extensibility\nThe class is a mixture of presentations and Hands On Labs, where you will get the chance to really get your fingers dirty with Team Foundation Server 2010.\nSee the full agenda and sign up here: http://www.cornerstone.se/Web/Templates/CoursePage.aspx?id=2528\u0026amp;course=COUR2010083117182403594425\u0026amp;epslanguage=SV\nIf you are interested in Visual Studio ALM training but can’t make it to these sessions, please contact me and we can set something up that fits you and your company.\n","permalink":"https://blog.ehn.nu/2012/01/tfs-2010-deep-dive-classes-in-stockholm/","summary":"\u003cp\u003eI’ll be running a Team Foundation Server 2010 Deep Dive class twice this spring in Stockholm at our friends at \u003ca href=\"http://www.cornerstone.se/sv/\"\u003eCornerstone\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eThe class is 4 days and we will be “diving deep” into all aspects of TFS 2010, including:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eDeployment\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eAdministration\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eSource Control\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eCheck-in Policies\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eBranching strategies\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eWork Items\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eOffice integration\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eReporting\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eCustomization\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eTeam Build\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eWorking with build definitions\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eDeveloping Custom Activities\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eAutomatic deployment\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eTest Management\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eMicrosoft Test Manager\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eCreating and running manual tests\u003c/p\u003e","title":"TFS 2010 Deep Dive classes in Stockholm"},{"content":"At my company 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.\nCreating a work item using the TFS API is simple, just connect to TFS, get the WorkItemStore service object and create a new work item and set any fields that you want to: Creating a work item\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ //Connect to TFS and get the WorkItemStore object var tfs = new TfsTeamProjectCollection(new Uri(\u0026#34;http://localhost:8080/tfs\u0026#34;)); var wis = tfs.GetService(typeof(WorkItemStore)) as WorkItemStore; //Get team project var teamProject = wis.Projects[\u0026#34;Demo\u0026#34;]; //Get the Bug Work Item Type var wit = teamProject.WorkItemTypes[\u0026#34;Bug\u0026#34;]; //Create a new Bug work item and set the title field WorkItem wi = new WorkItem(wit); wi.Title = \u0026#34;New Bug In New Area\u0026#34;; wi.Save(); Creating an area or iteration is equally simple:\nCreating an area\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ //Connect to TFS and get the ICommonStructureService object var tfs = new TfsTeamProjectCollection(new Uri(\u0026#34;http://localhost:8080/tfs\u0026#34;)); var css = tfs.GetService(typeof(ICommonStructureService)) as ICommonStructureService; //Get the root path of the new area string rootNodePath = \u0026#34;\\Demo\\Area\u0026#34;; var pathRoot = css.GetNodeFromPath(rootNodePath); //Create the new area, in this case it will be a new root area css.CreateNode(\u0026#34;NewRootArea\u0026#34;, pathRoot.Uri); BUT (yes there is a but, you could sense it coming), when you combine these two fellows into one task, e.g. create a new area (or iteration) and then create a new work item in that area, chances are high that you will receive the following exception:\nMicrosoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.Save(SaveFlags saveFlags) at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.Save() The meaning of the error is not obvious, but if you would call the Validate() method before calling Save() (which you should, of course) you would see that it returns the Area field indicating that this field is the problem.\nThe underlying problem here is that in the TFS Data Store, work items and areas/iterations are persisted in two different stores. And these stores need to be synchronized before you can reference any new items that you added. You’ll notice the same issue in Visual Studio as well, when you create a new area or iteration in Team Explorer, you need to refresh Team Explorer in order to use the new nodes for work items.\nBut how do we do this programmatically? There actually two things that needs to be done:\nRequest that the work item store is synchronized with the Common Structure store Refresh the local cache Which is translated into the following code\nSynchronize External Stores\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ //Synchronize the work item store with external stores (e.g. CSS) private static void SyncExternalStructures(TfsTeamProjectCollection tfs, WorkItemStore wis, ICommonStructureService css, string teamProject) { //Get work item server proxy object WorkItemServer witProxy = (WorkItemServer)tfs.GetService(typeof(WorkItemServer)); //Get the team project ProjectInfo projInfo = css.GetProjectFromName(teamProject); //Sync External Store witProxy.SyncExternalStructures(WorkItemServer.NewRequestId(), projInfo.Uri); //Refresh local cache wis.RefreshCache(); } Call this method after creating the area/iterations and before creating the new work item and it will work as expected\nComments Imported from the original WordPress site. Closed for new replies.\nOhad Tsamir — 19 Jan 2016\nYou just solved my problem cleanly and accurately, and this resource is quite poorly documented and was extremely hard to find on this world wide web.\nMany thanks :)\nOhad Tsamir,\nSenior software developer @Independer\n","permalink":"https://blog.ehn.nu/2012/01/avoiding-tf237124-when-creating-work-items-in-new-areas/","summary":"\u003cp\u003eAt my \u003ca href=\"http://www.inmetacrayon.no/English/about_inmeta/Pages/default.aspx\"\u003ecompany\u003c/a\u003e 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.\u003c/p\u003e\n\u003cp\u003eCreating a work item using the TFS API is simple, just connect to TFS, get the \u003ca href=\"http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.workitemstore(v=vs.100).aspx\"\u003eWorkItemStore\u003c/a\u003e service object and create a new work item and set any fields that you want to: \u003cbr\u003e\n\u003cstrong\u003e\u003cbr\u003e\nCreating a work item\u003c/strong\u003e\u003c/p\u003e","title":"Avoiding TF237124 when Creating Work Items in New Areas"},{"content":"The latest release of the Community TFS Build Extensions include a brand new tool called Community TFS Build Manager and has been created for two reasons:\nAn implementation of the Team Foundation Build API which is referenced by the Rangers Build Customization Guidance V2 (available H1 2012) \\ 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. The first version of the tool has been implemented by myself and Mike Fourie. You can download the extension from the Visual Studio Gallery here: http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c\nNote 1: The full source is available at the Community TFS Build Extension site\nNote 2: The tool is still considered alpha, so you should be a bit careful when running commands that modify or delete information in live environments, e.g. try it out first in a non-critical environment.\nNote 3: The tool is also available as a stand alone WPF application. To use it, you need to download the source from the CodePlex site and build it.\nGetting Started\nYou can either install the extension from the above link, or just open the Visual Studio Extension Manager and go to the Online gallery and search for TFS Build: \\\nAfter installing the build manager, you can start it either from the Tools menu or from the Team Explorer by right-clicking on the Builds node on any team project:\nThis will bring up a new tool window that will by default show all build definition in the currently selected team project.\n**\nView and sort Builds and Build Definitions across multiple Build Controllers and Team Projects **This has always been a major limitation when working with builds in Team Explorer, they are always scoped to a team project. It is particularly annoying when viewing queued builds and you have no idea what other builds are running on the same controller. In the TFS Build Manager, you can filter on one/all build controllers and one/all team projects:\nThe same filters apply when you switch between Build Definitions and Builds. In the following screen shot, you can see that three builds from three different team projects are running on the same controller:\nYou can easily filter on specific team projects and/or build controllers. Note that all columns are sortable, just click on the header column to sort it ascending or descending. This makes it easy to for example locate all build definitions that use a particular build process template, or group builds by team project etc.\nBulk operations on Build Definitions\nThe main functionality that this tool brings in addition to what Team Explorer already offers, is the ability to perform bulk operations on multiple build definitions/builds. Often you need to modify or delete several build definitions in TFS and there is no way to do this in Team Explorer.\nIn the TFS Build Manager, just select one or more builds or build definitions in the grid and right-click. The following context menu will be shown for build definitions:\nChange Build Process Templates\nThis command lets you change the build process template for one or more build definitions. It will show a dialog with all existing build process templates in the corresponding team projects: \\\nQueue\nThis will queue a “default” build for the the selected build definitions. This means that they will be queued with the default parameters.\nEnable/Disable\nEnables or disables the selected build definitions. Note that disabled build definitions are by default now shown. To view disabled build definitions, check the Include Disabled Builds checkbox:\nDelete\nThis lets you delete one ore more build definitions in a single click. In Team Explorer this is not possible, you must first delete all builds and then delete the build definition. Annoying! 🙂\nTFS Build Manager will prompt you with the same delete options as in Team Explorer, so no functionality is lost: \\\nSet Retention Policies\nAllows you to set retentions policies to several build definitions in one go. Note that only retention policies for Triggered and Manual build definitions can be updated, not private builds. This feature also gives you the same options as in Team Explorer: \\\nClone to Branch\nMy favorite feature 🙂 Often the reason for cloning a build definition is that you have created a new source code branch and now you want to setup a matching set of builds for the new branch. When using the Clone build definition feature of the TFS Power Tools, you must update several of the parameters of the build definition after, including:\nName Workspace mappings Source control path to Items to builds (solutions and/or projects) Source control path to test settings file Drop location Source control path to TFSBuild.proj for UpgradeTemplate builds All this is done automagically when using the Clone to Branch feature! When you select this command, the build manager will look at the Items to build path (e.g. solution/projects) and find all child branches to this path and display them in a dialog: \\\nWhen select one of the target branches, the new name will default to the source build definition with the target branch name appended. Of course you can modify the name in the dialog. After pressing OK, a new build definition will be created and all the parameters listed above will be modified accordingly to the new branch.\nBulk operations on Builds\nYou can also perform several actions on builds, and more will be added shortly. In the first release, the following features are available:\nDelete\nThis will delete all artifacts of the build (details, drops, test results etc..). It should show the same dialog as the Delete Build Definition command, but currently it will delete everything.\nOpen Drop Folders\nAllows you to open the drop folder for one or more builds\nRetain Indefinitely\nSet one or more builds to be retained indefinitely.\nBonus Feature – Generate DGML for your build environment\nThis feature was outside spec, but since I was playing around with generating DGML it was easy to implement this feature and it is actually rather useful. It quickly gives you an overview of your build resources, e.g. which build controllers and build agents that exist for the current project collection, and on what hosts they are running. The command is available in the small toolbar at the top, next to the refresh button:\nHere is an example from our lab environment:\nThe dark green boxes are the host machine names and the controller and agents are contained within them.\nNote: Currently the only way to view DGML files are with Visual Studio 2010 Premium and Ultimate.\nI hope that many of you will find this tool useful, please report issues/feature requests to the Community TFS Build Extensions CodePlex site!\nComments Imported from the original WordPress site. Closed for new replies.\nSG — 09 Dec 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/30/introducing-community-tfs-build-manager.aspx#641828\nWhy dont I see the Community Build Manager as an option when I connect my VS 2013 to a TFS-Git Repo? I\u0026rsquo;m trying to get to the \u0026ldquo;Clone Buid\u0026rdquo; option but no luck.\nJakob Ehn — 22 Dec 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/30/introducing-community-tfs-build-manager.aspx#642033\nIf you have installed the extension (and restarted Visual Studio) you should see it both in the Tools menu and also if you right-click on the Builds hub in Team Explorer\n/Jakob\nAlfred Poon — 08 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/30/introducing-community-tfs-build-manager.aspx#644654\nIs there a way to configure the \u0026ldquo;Delete Build Definition\u0026rdquo; dialog to have a different default versus deleting all. We wanted to set the default to not delete any Labels.\nSoujanya Naganuri — 15 Jun 2017\nThanks for sharing info on Introducing: Community TFS Build Manager\nShane Grant — 21 Jul 2022\nCan the default to load build definitions be configured?\n","permalink":"https://blog.ehn.nu/2011/12/introducing-community-tfs-build-manager/","summary":"\u003cp\u003eThe latest release of the \u003ca href=\"http://tfsbuildextensions.codeplex.com/\"\u003eCommunity TFS Build Extensions\u003c/a\u003e include a brand new tool called \u003cem\u003eCommunity TFS Build Manager\u003c/em\u003e and has been created for two reasons:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eAn implementation of the Team Foundation Build API which is referenced by the Rangers Build Customization Guidance V2 (available H1 2012) \\\u003c/li\u003e\n\u003cli\u003eProvide 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.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThe first version of the tool has been implemented by myself and \u003ca href=\"http://www.freetodev.com/\"\u003eMike Fourie\u003c/a\u003e. You can download the extension from the Visual Studio Gallery here: \u003cbr\u003e\n\u003ca href=\"http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c\" title=\"http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c\"\u003ehttp://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c\u003c/a\u003e\u003c/p\u003e","title":"Introducing: Community TFS Build Manager"},{"content":"Brian Harry just posted an update on the latest version of the TFS 2010 Power Tools. This will most likely by the last version of the Power Tools for the TFS 2010 version, next version will target Dev11!\nThe main improvements in this release are:\nTeam Foundation Server Power Tools for Eclipse\nMSSCCI Provider for 64-bit IDE’s\nVS 2010 Power Tools update\nImproved Work item Search\nBest Practice Analyzer now also analyzes the integration with Project Server, if you are using it\nCheck out the early Christmas gift here:\nhttp://blogs.msdn.com/b/bharry/archive/2011/12/16/december-2011-tfs-power-tools-release.aspx\nComments Imported from the original WordPress site. Closed for new replies.\nHairstyles Gallery — 15 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/16/december-2011-tfs-power-tools-release.aspx#612021\nI admire the valuable information you offer in your articles. of deep diving without having the least effect on Hope to see more from you.\nbaltimore locksmith — 01 Aug 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/16/december-2011-tfs-power-tools-release.aspx#617285\nWho knows a locksmith to make replacement keys for my bike in the fort worth area? i can take the bike/ignition just trying to save a few bucks,.,.\n","permalink":"https://blog.ehn.nu/2011/12/december-2011-tfs-power-tools-release/","summary":"\u003cp\u003e\u003ca href=\"http://blogs.msdn.com/b/bharry/\"\u003eBrian Harry\u003c/a\u003e just posted an update on the latest version of the TFS 2010 Power Tools. This will most likely by the last version of the Power Tools for the TFS 2010 version, next version will target Dev11!\u003c/p\u003e\n\u003cp\u003eThe main improvements in this release are:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eTeam Foundation Server Power Tools for Eclipse\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eMSSCCI Provider for 64-bit IDE’s\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eVS 2010 Power Tools update\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eImproved Work item Search\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eBest Practice Analyzer now also analyzes the integration with Project Server, if you are using it\u003c/p\u003e","title":"December 2011 TFS Power Tools Release"},{"content":"I often use the VS 2010/TFS 2010 evaluation virtual machines that Microsoft publishes every 6 months with the latest bits. It’s a great timesaver to use an image where everything is already setup and also contains a bit of sample data that is useful when you want to demo something for customers.\nThere is one thing that has always been a, albeit small, but still very annoying problem and that is that the builds always partially fail when you start using the image. When you want to demo the powerful feature of associated work items in a build, you’ll find yourself with your pants down since the build fails when trying to update the associated work item! Even when looking at the historical builds for the Tailspin Toys project, you will notice that they also partially failed:\nIf you look at the error message in the build details, you’ll see the following error:\nThe work item \u0026lsquo;XX\u0026rsquo; could not be updated: \u0026lsquo;TF237165: Team Foundation could not update the work item because of a validation error on the server. This may happen because the work item type has been modified or destroyed, or you do not have permission to update the work item.\u0026rsquo;\nThe problem here is that the build agent by default is running as the NT AUTHORITYSYSTEM account, which is an account that do not have permission to modify work items. Your best option here is to switch account and use the Network Service account instead. Open TFS Administration Console, and select the Build Configuration node. Press the Stop link in the Build Service section:\nSelect Properties and select NT AUTHORITYNetworkService as Credentials\nPress Start to start the build service with the new credentials.\nIf you would queue a new build now, the build would fail because of conflicting workspace mappings. The reason for this is that we haven’t changed the working folder path for the build agents, so when the build agent try to create a new workspace, the local path will conflict with the workspace previously created by NT AUTHORITYSYSTEM.\nSo to resolve this we can do two things:\n(Preferred). Delete the team build workspaces previously created by the SYSTEM account. To do this, start a Visual Studio command prompt and type: *tf.exe workspace /delete ;NT AUTHORITYSYSTEM * If you need to list the workspaces to get the names, you can type: *tf workspaces /owner:NT AUTHORITYSYSTEM /computer: * (Less preferred, but good if you want to switch back later to the old build service account) You can also modify the working folder path for the build agents, so that they don’t conflict with the existing workspaces. Click Properties on the build agent(s) and modify the Working Directory proprerty: b In this case, you can for example change it to $(SystemDrive)BuildsNS$(BuildAgentId)$(BuildDefinitionPath) where NS = Network Service. \\ ","permalink":"https://blog.ehn.nu/2011/12/tf237165-team-foundation-could-not-update-the-work-item-because-of-a-validation-error-on-the-server/","summary":"\u003cp\u003eI often use the VS 2010/TFS 2010 evaluation virtual machines that Microsoft publishes every 6 months with the latest bits. It’s a great timesaver to use an image where everything is already setup and also contains a bit of sample data that is useful when you want to demo something for customers.\u003c/p\u003e\n\u003cp\u003eThere is one thing that has always been a, albeit small, but still very annoying problem and that is that the builds always partially fail when you start using the image. When you want to demo the powerful feature of associated work items in a build, you’ll find yourself with your pants down since the build fails when trying to update the associated work item! Even when looking at the historical builds for the Tailspin Toys project, you will notice that they also partially failed:\u003c/p\u003e","title":"TF237165: Team Foundation could not update the work item because of a validation error on the server."},{"content":"*UPDATE 10.01.2012: *\nThe issue has been resolved by Microsoft and will be addressed in patch soon. Here is the full description from the Connect site: \\\n“We\u0026rsquo;ve identified the rootcause. This bug was introduced in the compatibility GDR patch released for VS 2010 to work against 2011 TFS Server. We shall be releasing a patch soon. Till then, please follow the workaround mentioned to unblock yourselves. “\nWhen setting up a physical environment for a new test controller on our TFS 2010 server, I ran into a problem that seems to be related to having installed the Visual Studio 2010 SP1 TFS Compatibility GDR and/or Visual Studio 2011 Developer Preview\non the same machine as Visual Studio 2010 (SP1)\nThe problem occurs when trying to add a test agent to the physical environment, MTM gives the following error: *\nFailed to obtain available machines from the selected test controller. * Clicking on the View details link shows the following error dialog: \\\nError dialog: Cannot communicate with the Controller due to version mismatch\nI have investigated the problem together with Microsoft, and they are working on finding out why this is happening. I have posted the issue on the Connect site here: https://connect.microsoft.com/VisualStudio/feedback/details/712290/microsoft-test-manager-2010-can-not-communicate-with-test-controllers-when-visual-studio-11-is-installed-on-the-same-machine\nWorkaround\nFortunately, we found a workaround that is not too bad. When facing this problem, go the the Controllers tab that list all the controllers. If you select the controller from the list, it will actually show the test agent.\nThen go back to the Environments tab and voila, the test agent appears now on the list. It seems like the\nI’ll post an update when the issue has been resolved by MS\nComments Imported from the original WordPress site. Closed for new replies.\nQinyuan Zhang — 01 Apr 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/09/compatibility-problem-with-microsoft-test-manager-2010-and-visual-studio.aspx#626588\nIs there any updated about this issue?It had been fixed or not , currently I use API to invode method in Microsoft.VisualStudio.QualityTools.ControllerObject.dll, if client had installed the vs2010 sp1 my application will throw out an exception of \u0026lsquo;{Microsoft.VisualStudio.TestTools.Controller.ControllerConnectionException: Cannot communicate with the Controller due to version mismatch\nat Microsoft.VisualStudio.TestTools.Controller.ControllerConnectionManager.InternalConnect(ControllerConnectionInfo controllerConnectionInfo)\nat Microsoft.VisualStudio.TestTools.Controller.ControllerConnectionManager.Connect(ControllerConnectionInfo connectionInfo)\nat Microsoft.VisualStudio.TestTools.Controller.ControllerConnectionManager.Connect(String fullControllerName)}\u0026rsquo;\n","permalink":"https://blog.ehn.nu/2011/12/compatibility-problem-with-microsoft-test-manager-2010-and-visual-studio-2011/","summary":"\u003cp\u003e*\u003cem\u003eUPDATE 10.01.2012: *\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eThe issue has been resolved by Microsoft and will be addressed in patch soon. Here is the full description from the Connect site: \\\u003c/p\u003e\n\u003cp\u003e\u003cem\u003e“We\u0026rsquo;ve identified the rootcause. This bug was introduced in the compatibility GDR patch released for VS 2010 to work against 2011 TFS Server. We shall be releasing a patch soon. Till then, please follow the workaround mentioned to unblock yourselves. “\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eWhen setting up a physical environment for a new test controller on our TFS 2010 server, I ran into a problem that seems to be related to having installed the \u003ca href=\"http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=39070\"\u003eVisual Studio 2010 SP1 TFS Compatibility GDR\u003c/a\u003e and/or \u003ca href=\"http://www.microsoft.com/download/en/details.aspx?displaylang=en\u0026amp;id=27543\"\u003eVisual Studio 2011 Developer Preview\u003c/a\u003e\u003c/p\u003e","title":"Compatibility Problem with Microsoft Test Manager 2010 and Visual Studio 2011"},{"content":"Anyone working with developing custom activities in TFS 2010 Build has run into the following dreadful error message when running the build:\nTF215097: An error occurred while initializing a build for build definition TeamProjectMyBuildDefinition: Cannot create unknown type \u0026lsquo;{clr-namespace:[namespace];assembly=[assembly]}Activity\nWhat the error means is that when the TFS build service loads the build process template XAML for the build definition, it can’t create an instance of the customer workflow activity that is referenced from it.\nThe problem here is that there are several steps that all need to be done correctly for this process to work.\nMake sure that:\nWhen developing custom workflow, you keep the XAML builds template workflows in one project, and the custom activities in another project. The template workflow project shall reference the custom activities project. This setup also makes sure that your custom activities show up in the toolbox when designing your workflow. \\ You have checked in the modified version of the XAML workflow (easy to forget) \\ Your custom activity has the the BuildActivityAttribute: \\ Your custom activity is public (common mistake…) \\ You have configured your build controller with the path in source control where the custom activities are located \\ Verify that all dependencies for the custom activity assembly/assemblies have been checked into the same location as the assembly NB: You don’t need to check in TFS assemblies and other references that you know will be in the GAC on the build servers. \\ The reference to the custom activity assembly in the XAML workflow is correct: xmlns:obc=\u0026#34;clr-namespace:Inmeta.Build.CustomActivities;assembly=Inmeta.Build.CustomActivities\u0026#34; But, even if you have all these step done right, you can still get the error. I had this problem recently when working with the code metrics activities for the http://tfsbuildextensions.codeplex.com/ community project. The thing that saved me that time was the Team Foundation Build Service Events eventlog. This is a somewhat hidden “feature” that is very useful when troubleshooting build problems. You find it under Custom View in the event log on the build servers\nIn this case I had the following message there:\nService \u0026lsquo;LT-JAKOB2010 - Agent1\u0026rsquo; had an exception: Exception Message: Problem with loading custom assemblies: Method \u0026lsquo;get_BuildAgentUri\u0026rsquo; in type \u0026lsquo;TfsBuildExtensions.Activities.Tests.MockIBuildDetail\u0026rsquo; from assembly \u0026lsquo;TfsBuildExtensions.Activities.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\u0026rsquo; does not have an implementation. (type Exception)\nWhich made me realize that I had by accident checked in one of the test assemblies into the custom activity source control folder in TFS.\nUnfortunately this whole process with developing you own custom activities is problematic and error prone, hopefully this will be better in future versions of TFS. Once you have your setup working however, changing and adding new custom activities is easy. And deployment is a breeze thanks to the automatic downloading and recycling of build agents that the build controller handles.\nComments Imported from the original WordPress site. Closed for new replies.\nSylvain Lavoie — 28 Feb 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/08/tfs-2010-build---troubleshooting-the-tf215097-error.aspx#609009\nHi Jacob, Very great post. He helped me a lot to solve custom activity issues.\nOwever, I have a similar problem with an Activity I writen to execute Visual Build Pro using is the com dll. Maybe you could give me some hint. The activity run fine on x86 xp. On Windows 7 64, the only thing I have in the log is Exception Message: Problem with loading custom assemblies: Could not load file or assembly \u0026lsquo;file:///C:UsersusernameAppDataLocalTempBuildAgent30VisBuildSvr.dll\u0026rsquo; or one of its dependencies. The module was expected to contain an assembly manifest. (type Exception)\nWhen I try to attach the debugger I saw an exception :\nA first chance exception of type \u0026lsquo;System.IO.FileNotFoundException\u0026rsquo; occurred in mscorlib.dll\nAdditional information: Could not load file or assembly \u0026lsquo;Interop.VisBuildSvr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d64ea679b6fd0408\u0026rsquo; or one of its dependencies. The system cannot find the file specified.\nThanks\npavel — 16 May 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/08/tfs-2010-build---troubleshooting-the-tf215097-error.aspx#613783\nGreat post! along with other articles on TFS build.. Thanks!\nSubrat — 29 May 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/08/tfs-2010-build---troubleshooting-the-tf215097-error.aspx#629007\nHello,\nI am getting a same error, while I am importing a Powershell Workflow activity into toolbox. Its imported successfully but while executing it gives the below error.\nTF215097: An error occurred while initializing a build for build definition Exception Message: Cannot create unknown type \u0026lsquo;{clr-namespace:StopService;assembly=StopService}StopService\u0026rsquo;. (type XamlObjectWriterException)Exception Stack Trace: The Activities has been created by using the steps in http://msdn.microsoft.com/en-us/library/hh852743(v=vs.85).aspx\nThe DLL is created and successfully imported into workflow toolbox, but while using it in a build its giving the above error.\nJakob Ehn — 29 May 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/12/08/tfs-2010-build---troubleshooting-the-tf215097-error.aspx#629008\n@Subrat: Did you remember to check in the assembly in the custom assembly version control path (bullet nr 5 above)?\n/Jakob\n","permalink":"https://blog.ehn.nu/2011/12/tfs-2010-build-troubleshooting-the-tf215097-error/","summary":"\u003cp\u003eAnyone working with developing custom activities in TFS 2010 Build has run into the following dreadful error message when running the build:\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eTF215097: An error occurred while initializing a build for build definition TeamProjectMyBuildDefinition: Cannot create unknown type \u0026lsquo;{clr-namespace:[namespace];assembly=[assembly]}Activity\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWhat the error means is that when the TFS build service loads the build process template XAML for the build definition, it can’t create an instance of the customer workflow activity that is referenced from it.\u003c/p\u003e","title":"TFS 2010 Build - Troubleshooting the TF215097 error"},{"content":"Today the first stable release of the Community TFS 2010 Build Extensions shipped on the CodePlex site. Visual Studio ALM MVP Mike Fourie (aka Mr MSBuild Extension Pack) 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.\nThe build extensions contain approximately 100 custom activities that covers several different areas, such as IIS7, Hyper-V, StyleCop, NUnit, Powershell etc, as well as some core functionality (Assembly versionig, file management, compression, email etc etc). In addition to more activities in upcoming releases, the plan is to include build process templates for different scenarios.\nPlease download the release and try it out, and give us feedback!\nTo give you a hint of the content, here is a class diagram that shows the content of the “Core” activities project (there are several other projects included as well):\n","permalink":"https://blog.ehn.nu/2011/07/first-stable-release-of-the-community-tfs-2010-build-extensions/","summary":"\u003cp\u003eToday the first stable release of the \u003ca href=\"http://tfsbuildextensions.codeplex.com/\"\u003eCommunity TFS 2010 Build Extensions\u003c/a\u003e shipped on the CodePlex site. Visual Studio ALM MVP \u003ca href=\"http://freetodev.com/\"\u003eMike Fourie\u003c/a\u003e (aka Mr \u003ca href=\"http://msbuildextensionpack.codeplex.com/\"\u003eMSBuild Extension Pack\u003c/a\u003e) 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.\u003c/p\u003e","title":"First stable release of the Community TFS 2010 Build Extensions"},{"content":"** Source available at http://mergeworkitems.codeplex.com/ **\nHalf a year ago I wrote about about Merging Work Items 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.\nI 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:\nThe technical solution turned out to be a bit complicated. The problem was/is that it is not possible to modify the list of associated work items in the current pending changes using the API. This was a show stopper and the only way around it was to add another component that was executed on the server after the check-in that did the actual association. The information about the selected work items was temporarily stored in the comments of the changeset. This worked, but complicated the deployment. \\ The feedback internally at Inmeta was that why should the developer be allowed to select which work items that should be associated? If a work item was associated with a changeset in a Main branch, it should always be associated with the merge changeset when merging to a Release branch. So the association should be done automatically. For these reasons I changed the implementation and converted the check-in policy to a TFS server side event handler instead (for more info on work with these event handlers, check out my post about them here: Server Side Event Handlers in TFS 2010)\nBy having the association done server side, the process is very smooth for the developer. When a changeset that contains merges is checked in, the event handler evaluates all merges and associates the work items. If a work item has already been associated by the developer, it is of course not associated again. Since it is implemented with a server side event handler, it runs instantly without the user ever really noticing it.\nLet’s look at how this works. Lets say that we have the following branch hierarchy: \\\nNow, one of our finest developers have both fixed a bug and added a new user story in the Main branch. That was two changesets, each changeset was associated with a corresponding work item:\nNow, we want to push these changes to the 2.0 Release branch. So the developer performs a merge from Main to the 2.0 branch.\nAt this point, instead of manually adding the work items, the developer just checks in the changes. After this, lets take a look at the source history\nDouble-clicking on the latest changeset, we can see the following information on the work items tab: \\\nThe work items associated with the original changesets that was merged to the R2.0 branch, have been associated with the new changeset. Also, double-clicking on one of the work items, we can see that the server event handler has added a link to the changeset for this work item: \\\nNote the following:\nThe changeset has been linked in the same way as when you associate a work item manually. \\ The change was done by the developer account (myself in this sample), and not the TFS service account. This is because the event handler uses the new TFS Impersonation API to impersonate the user who committed the check-in. \\ The history comment is a bit different than the usual (“Associated with changeset XXX”), just to highlight the reason for the change. \\ If the changeset would contain both merges and other types of pending changes, the merges would still be traversed, the other changes are just ignored. **Deployment **Deploying the server side event handler couldn’t be easier, just drop the Inmeta.TFS.MergeWorkItemsEventHandler.dll assembly into the plugin directory of the TFS AT server. This path is usually %PROGRAMFILES%Microsoft Team Foundation Server 12.0Application TierWeb ServicesbinPlugins. Note: This will cause TFS to recycle to load the new assembly, so in production you might want to schedule this to minimize problems for your users. See my post more details on this.\n**\nImplementation **I have uploaded the source code to CodePlex at: http://mergeworkitems.codeplex.com/ so you can check out the details there. One thing that is worth mentioning is that I had to resort to the TFS Client API to access and modify the associated work items. The TFS Server Side object model is not very documented, and according to Grant Holiday (in this post) the server object mode for work item tracking is not very useful. So instead of going down that road, I used the client object model to do the work Not as efficient, but it gets the job done. Note that the event handler hooks into the Notification decision point, which is executed asynchronously after the check-in has been done, and therefor it doesn’t have a negative impact on the overall check-in process.\nHope that you find the event handler useful, contact me either through this blog or via the CodePlex site if you have any questions and/or feature requests.\nComments Imported from the original WordPress site. Closed for new replies.\nThiago — 17 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#578244\nYou couldn\u0026rsquo;t have posted this at a better time! Thanks!\nM Hamlin — 18 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#578267\nDitto! Thanks so much!\nRené Hjorth — 18 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#578327\nYour a lifesaver! :)\nMaxim — 27 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#579910\nWow! This is great job! Thank you!\nPradeep Y — 23 Jun 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#583076\nGood Post. Can you locate me the sources to learn TFS programming? I found very less documentation on this.\nAnd, I have as old ASP.NET Issue tracker application to manage all bugs. Now I would like to integrate my legacy application with TFS such a way that, TFS work items should be created automatically, whenever I create a bug in my ASP.NET issue tracker application. If status updated in TFS WI, the same should reflect in ASP.NET application.\nCan you suggest me the high level design for this integration?\\\nJed — 30 Jun 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#584003\nYou should do a blog series explaining getting merge info since all I could find on how to do this was some massive series on what was required for an older TFS version, and TFS2010 MergeSources was always empty. Someone else ran into this:\nhttp://stackoverflow.com/questions/3772674/how-is-the-change-mergesources-field-populated-in-tfs\nHere is a summary of the blog series on getting merge info:\nhttp://blogs.msdn.com/b/buckh/archive/2006/02/21/bobmergeapi.aspx\nFanija — 15 Sep 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#593955\nI am really looking forward to implementing this. The only question I have is currently we are still running TFS 2008, and although we have in plan to upgrade to TFS 2010 in the next few months, I want to implement this sooner. Will this work with TFS 2008? And if so, do I place the Inmeta.TFS.MergeWorkItemsEventHandler.dll in Microsoft Visual Studio 2008 Team Foundation ServerWeb ServicesVersionControlbin? Thanks a lot in advance.\nJakob Ehn — 15 Sep 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#593956\n@Fanija: Server event handlers are new in TFS 2010, so this will not work in TFS2008. You could however extract the source and place it in a standard web service event handler that you can create a subscription for. It will not be as immediate as this solution but it should work\nSven — 18 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#597126\nHi,\nI have a question. When I resolve a bug in a release branch and merge it into the main branch and later merge it again in the release branch is the work item always associated?\nRegards,\nSven\nLarry — 09 Nov 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#599403\nAwesome post! This should definitely be included as part of the base functionality of TFS\u0026hellip;\nnikita — 24 Dec 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#603759\nThanks! Works perfect!\nMani — 31 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#606822\nhttp://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx\nThis brings duplicate when you merge the main branch back into the development branch.\nis there anyway we can eliminate it?\nThanks,\nMani\nJaleel — 27 Mar 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#611071\nAppreciate your code. It is simply great!\nI have a question though. I was debugging the source code of yours. I get the changeset number as -1 . Any idea about this?\npublic EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType,\nobject notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties)\n{\nstatusCode = 0;\nproperties = null;\nstatusMessage = string.Empty;\nif (notificationType == NotificationType.DecisionPoint)\n{\ntry\n{\nif (notificationEventArgs is CheckinNotification)\n{\nCheckinNotification notification = notificationEventArgs as CheckinNotification;\nChangeset cs = requestContext.GetChangeset (notification.Changeset); // I get changeset number as -1 here\nJohn Ames — 18 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#612200\nQuestion?\nHow is this reflected on Build reports? I thought a Work Item will only reflect one \u0026ldquo;Fixed in\u0026rdquo; build. How then if one Work Item is associated with multiple changesets in different release branchs do you account for what build this was fixed in?\nJakob Ehn — 18 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#612203\n@John: If you associate several work items with a changeset, they will all appear in the \u0026ldquo;Associated Work Items\u0026rdquo; section of the build summary, and the build will update all work items with the Fixed in build information.\nAnd as you note, every new build will update the same work item with the new build number. If this is not what you want, you can take the route where you simple create a new work item for each branch.\nJakob Ehn — 18 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#612204\n@Jaleel: This is because you are responding to a DecisionPoint event, which is before the checkin is persisted. You should check for NotificationType.Notification instead, which will be executed after the checkin has been stored to the database\nPradeep Y — 22 Jun 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#615415\nIs this addressed in TFS 2012? Any Idea.?\nCarl O — 25 Jul 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#616980\nThank you for this contribution to the community. I have implemented the plugin in our Test TFS environment and validated that it will work for our branching/merging scenarios. This small plugin is extremely useful to the company i\u0026rsquo;m at! I will be sure to follow the development posted at http://tfsbuildextensions.codeplex.com/\nThanks again!\nJakob Ehn — 20 Aug 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#618043\n@Carl: Thanks, glad that it helped!\\\nJakob Ehn — 20 Aug 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#618044\n@Pradeep: No, thre is no change around this in TFS 2012. I just uploaded a TFS 2012 compatible version to CodePlex\\\nTown — 17 Dec 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#634367\nHi,\nThis plugin looks like exactly what I need\u0026hellip; :)\nIs the version available on CodePlex from March this year compatible with both 2010 and 2012? Cheers.\nJakob Ehn — 17 Dec 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#634368\n@Town: Serverside plugins are bound to the version of the TFS server. I upgraded the Main branch to TFS 2012 in march, but the old version for TFS 2010 is still available in a separate branch called TFS2010. You can either get that branch and build it, or you can download the original 1.0.0.0 version that supports TFS 2010.\n\\\nRené Hjorth — 25 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#635851\nThis was the most important plugin in my TFS2010 installation - but now I have upgraded to TFS2013.\nHow to I a) use this plugin with 2013, b) use this plugin with 2013? :)\nMany thanks Jakob - you\u0026rsquo;re a hero!\nJakob Ehn — 28 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#635947\nHi Rene, and thanks! I upgraded the project to TFS 2012 a year ago, but in order to use it with TFS 2013 you need to recompile it against the TFS 2013 object model. I\u0026rsquo;ll see if I get the time to do that this weekend\n/Jakob\nRene' Hjorth — 03 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#635983\nThanks in advance, I\u0026rsquo;ll cross my fingers :)\nRene' Hjorth — 03 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#635983\nThanks in advance, I\u0026rsquo;ll cross my fingers :)\nRene' Hjorth — 10 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#636188\nI keep crossing my fingers for a weekend to come, where customers, family or other interests doesn\u0026rsquo;t comes in the way :)\nRene' Hjorth — 10 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#636188\nI keep crossing my fingers for a weekend to come, where customers, family or other interests doesn\u0026rsquo;t comes in the way :)\nJakob Ehn — 12 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#636244\n@Rene, it worked, I just uploaded a new release (1.1.0) that supports TFS 2013 :-)\nRene' Hjorth — 20 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#636457\nBrilliant! Many thanks Jakob - it\u0026rsquo;s really works!\nRene' Hjorth — 20 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#636457\nBrilliant! Many thanks Jakob - it\u0026rsquo;s really works!\nVinícius Almeida — 15 Jul 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#638830\nHi Jackob,\nFirst of all, congratulations for the well done job. It worked perfect in our TFS 2013.\nBut, in our environment, we have various Git repositories alongside TFVS repos, which of course the developers wanted to use your plugin with. Of course it didn\u0026rsquo;t worked, and digging around in MSDN I\u0026rsquo;ve noticed that Git repositories has its own classes in TFS API.\nFor example, instead check-ins there is pushes, and instead changesets there is commits.\nDo you already have plans to implement in your plugin the ability to work in Git repositories? Sorry for my question, that\u0026rsquo;s because I\u0026rsquo;m an infrastructure specialist, and I\u0026rsquo;m a newbie in development\u0026hellip; Thanks for your attention, and again, great work!\nvletroye — 08 Sep 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#640628\nWorks fine also on our TFS 2013.. Really a great feature !\nNotice: the username associated with the workitems on the target branch is the tfs build service account when there is a gated build defined on that branch\u0026hellip; The actual check-in is indeed executed from the build server. Is there any trick to retrieve the name of the user who did the initial check-in ?\nJakob Ehn — 18 Nov 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#641462\n@vletroye: Good question, I\u0026rsquo;ll look into that\nFred — 10 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#642908\nHi Jakob,\nWe intend to use your plugin which seems to perfectly fit our needs. However before deploying it, i\u0026rsquo;d have a question.\nWe use today in my company a branching policy for our bug fixes where the developers merge themselves their changesets from a \u0026ldquo;Fixes\u0026rdquo; branch to a \u0026ldquo;Servicing\u0026rdquo; branch\u0026quot; then from the \u0026ldquo;Servicing\u0026rdquo; branch to the \u0026ldquo;Main\u0026rdquo; branch and finally from the \u0026ldquo;Main\u0026rdquo; branch into the \u0026ldquo;Dev\u0026rdquo; branch.\nThus as you\u0026rsquo;ve certainly guessed each time they have to re-associate the same WIs for each merge which is i have to confess very painful for them!\nThat\u0026rsquo;s why your plugin may be the key for our problem. However to simplify their work, many developers merge several changesets (and the associated WIs) at the same time from the \u0026ldquo;Fixes\u0026rdquo; branch\u0026quot; to the \u0026ldquo;Servicing\u0026rdquo; branch and once it\u0026rsquo;s done, have only the resulting changeset to merge in the \u0026ldquo;Main\u0026rdquo; branch and finally into the \u0026ldquo;Dev\u0026rdquo; branch\u0026quot;. Here is my question. In the particular case described just above, will your plugin allow us to find all the required WIs into the final branch (ie the \u0026ldquo;Dev\u0026rdquo; branch).\nThanks in advance for your answer :) !\nFred\nJakob Ehn — 13 Feb 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#642963\n@Fred: Yes, the extension will look at the merge and then traverse all changesets (recursivelty) that was part of that merge and aggregate the associated work items for each changeset.\nSo it should work just fine for your case\nAlex Vezenkov — 26 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#644995\nWhat about Visual Studio Online? Do you suggest to use a service hook? IMO the best solution is to have a tool where you could select multiple changesets and with one click merge them all separate merge changesets, so that each commit has the same description and workitem association as well. This is the ideal, otherwise it\u0026rsquo;s just a complication. Immagine 100 changesets, merged and conflict resolved at once in one merge changeset. Even if this single merge changeset is associated to all the workitems of the original changsets, it\u0026rsquo;s still an ugly mess to track what was merged and if merged properly. So think about it. In case you are interested in developing such a client tool, please contact me. I\u0026rsquo;m interested in contributing.\nRegards,\nAlex Vezenkov\nDevOps Ltd., Bulgaria\nronald — 15 Oct 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx#646665\nThanks a lot for this solution. worked fine for me.\ndo have also the tfs 2015 in your planning ;) ?\nthanks,\nronald\n","permalink":"https://blog.ehn.nu/2011/05/automatically-merging-work-items-in-tfs-2013/","summary":"\u003cp\u003e** Source available at \u003ca href=\"http://mergeworkitems.codeplex.com/\" title=\"http://mergeworkitems.codeplex.com/\"\u003ehttp://mergeworkitems.codeplex.com/\u003c/a\u003e **\u003c/p\u003e\n\u003cp\u003eHalf a year ago I wrote about about \u003ca href=\"http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx\"\u003eMerging Work Items\u003c/a\u003e 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.\u003c/p\u003e\n\u003cp\u003eI 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:\u003c/p\u003e","title":"Automatically Merging Work Items in TFS 2013"},{"content":"This weekend we at Inmeta release a free Visual Studio 2010 Team Explorer extensions that solves the problem with the Builds node in the Team Explorer not being hierarchic. For some reason, this part of the Team Explorer didn’t get the nice hierarchical folder structure that the Work items node got in 2010. The result is that, for a company that has several hundreds of builds in the same team project, it becomes very hard to navigate.\nThe solution that we implemented is very simple and uses a naming convention to group the build definitions in folders. The default separator is ‘.’ (dot) which is prabably the most common convention used anyway. As it turns out, Microsoft DevDiv uses this convention internally, as posted by Brian Harry. And they have a lot of build definitions…. 🙂\nThis is what the build explorer looks like:\nAs you can see, if you have a multi-part name, such as Inmeta.TFS Exception Reporter.Production, you get two folders in the hierarchy.\nThe Build Explorer is available in the Visual Studio Gallery, either download it from http://visualstudiogallery.msdn.microsoft.com/35daa606-4917-43c4-98ab-38632d9dbd45, or use the Visual Studio Extension Manager directly (search for Inmeta): \\\nThe extension was developed mostly by Lars Nilsson, with some smaller additions by myself and Terje Sandström.\nThe source code is available at http://tfsbuildfolders.codeplex.com. Let us know what you think and if you want to contribute, contact me or Terje at the Codeplex site.\n","permalink":"https://blog.ehn.nu/2011/04/tfs-2010-inmeta-build-explorer/","summary":"\u003cp\u003eThis weekend we at Inmeta release a free Visual Studio 2010 Team Explorer extensions that solves the problem with the Builds node in the Team Explorer not being hierarchic. For some reason, this part of the Team Explorer didn’t get the nice hierarchical folder structure that the Work items node got in 2010. The result is that, for a company that has several hundreds of builds in the same team project, it becomes very hard to navigate.\u003c/p\u003e","title":"TFS 2010 Inmeta Build Explorer"},{"content":"The build process template and custom activity described in this post is available here: http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/Inmeta%20TFS%20Build%20Sample.zip\nRunning code metrics has been available since VS 2008, but only from inside the IDE. Yesterday Microsoft finally released Visual Studio Code Metrics Power Tool 10.0, a command line tool that lets you run code metrics on your applications. This means that it is now possible to perform code metrics analysis on the build server as part of your nightly/QA builds. In this post I will show how you can run the metrics command line tool from a build, and also a custom activity that reads the output and appends the results to the build log, and fails the build if the metric values exceeds certain (configurable) treshold values.\nThe code metrics tool analyzes all the methods in the assemblies, measuring cyclomatic complexity, class coupling, depth of inheritance and lines of code. Then it calculates a Maintainability Index from these values that is a measure of how maintanable this method is, between 0 (worst) and 100 (best). For information on how this value is calculated, see http://blogs.msdn.com/b/codeanalysis/archive/2007/11/20/maintainability-index-range-and-meaning.aspx. After this it aggregates the information and present it at the class, namespace and module level as well.\n**\nRunning Metrics.exe in a build definition **Running the actual tool is easy, just use a InvokeProcess activity last in the Compile the Project sequence, reference the metrics.exe file and pass the correct arguments and you will end up with a result XML file in the drop directory. Here is how it is done in the attached build process template:\nIn the above sequence I first assign the path to the code metrics result file ([BinariesDirectory]result.xml) to a variable called MetricsResultFile, which is then sent to the InvokeProcess activity in the Arguments property. Here are the arguments for the InvokeProcess activity:\nNote that we tell metrics.exe to analyze all assemblies located in the Binaries folder. You might want to do some more intelligent filtering here, you probably don’t want to analyze all 3rd party assemblies for example. Note also the path to the metrics.exe, this is the default location when you install the Code Metrics power tool. You must of course install the power tool on all build servers. Using the standard output logging (in the Handle Standard Output/Handle Error Output sections), we get the following output when running the build:\nIntegrating Code Metrics into the build Having the results available next to the build result is nice, but we want to have results integrated in the build result itself, and also to affect the outcome of the build. The point of having QA builds that measure, for example, code metrics is to make it very clear how the code being built measures up to the standards of the project/company. Just having a XML file available in the drop location will not cause the developers to improve their code, but a (partially) failing build will! 🙂\nTo do this, we need to write a custom activity that parses the metrics result file, logs it to the build log and fails the build if the values frfom the metrics is below/above some predefined treshold values.\nThe custom activity performs the following steps\nParses the XML. I’m using Linq 2 XSD for this. Since the XML schema for the result file is available with the power tool, it is vey easy to generate code that lets you query the structure using standard Linq operators. \\ Runs through the metric result hierarchy and logs the metrics for each level and also verifies maintainability index and the cyclomatic complexity against the treshold values. The treshold values are defined in the build process template and are sent in as arguments to the custom activity ** If the treshold limits are exceeded, the activity either fails or partially fails the current build. For more information about the structure of the code metrics result file, read Cameron Skinner\u0026rsquo;s post about it. It is very simple and easy to understand. I won’t go through the code of the custom activity here, since there is nothing special about it and it is available for download so you can look at it and play with it yourself.\nThe treshold values for Maintainability Index and Cyclomatic Complexity is defined in the build process template, and can be modified per build definition: \\\nI have chosen the default values for these settings based on a post from my colleague Terje Sandström - Code Metrics - suggestions for approriate limits. When you think about it, this is quite an improvement compared to using code metrics inside the IDE, where the Red/Yellow/Green limits are fixed (and the default values are somewhat strange, see Terjes post for a discussion on this)\nThis is the first version of the code metrics integration with TFS 2010 Build, I will probably enhance the functionality and the logging (the “tree view” structure in the log becomes quite hard to read) soon. I will also consider adding it to the Community TFS Build Extensions site when it becomes a bit more mature.\nAnother obvious improvement is to extend the data warehouse of TFS and push the metric results back to the warehouse and make it visible in the reports.\nComments Imported from the original WordPress site. Closed for new replies.\nRick — 31 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#560235\nHi,\nGreat start, however the sample code appears to be missing some things, such as the definition of the Metric class as well as the CodeMetricsReport.Load methods. Are you missing files?\n\\\nJakob Ehn — 31 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#560270\n@Rick: Sorry about that, I uploaded the full project now instead of the separate source files\nkidambi — 01 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#560542\nThanks a lot for this. However when I try to run my build process, I get could not find XML.Schema.Linq.dll eventhough I installed it in GAC. Would you please tell me what I\u0026rsquo;m missing? Any help would be much appreciated.\nJakob Ehn — 01 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#560563\n@Kidambi: You should not install it in the GAC, add it to source control, next to the custom activities assembly\nAntony — 20 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#574734\nErr, I\u0026rsquo;ve downloaded the sample, built it, but how do I deploy it to the build server so that I can set up a build to use it?\nJason Cornwall — 10 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#577403\nThanks for the sample, got it up and running, although I\u0026rsquo;m curious why you are processing metrics on all the levels, for example the cyclomatic value for the module, which is a aggregation of the namespaces. My particular assembly that is being evaluated has a module cyclomatic value of 111, which exceeds the threshold therefore the build fails. However, the members in the module don\u0026rsquo;t exceed the threshold which my understanding is the only part that actually matters?\nkarthik — 28 Sep 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#595378\nThanks Jakob. The instructions are very clear and I\u0026rsquo;ve setup the metrics with help of your post and http://blogs.microsoft.co.il/blogs/shair/archive/2011/02/07/integrating-code-metrics-in-tfs-2010-build-wf-4-0.aspx\nI got the outputs.xml file created but stuck in parsing the output into a readable format as part of Build log.\nCould you please point me somewhere where I can get some more details on it.\nThorsten — 24 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#620686\nDo you have some additional advice how to push the data into warehouse?\nbest regards\nThorsten\nKidambi — 04 Apr 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#636888\nHi,\nThis is great. Exactly what I was looking for. However I\u0026rsquo;m looking to download the source code and I could not get to it. Would you please point me from where I can download the code?\nThanks a lot.\nRegards,\nKidambi\nJakob Ehn — 07 Apr 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#636947\n@Kidimbi: This activity is now part of the Community TFS Build Extensions, and has been worked on since this blog post. Please check it out over at http://tfsbuildextensions.codeplex.com/\n/Jakob\nLuis — 08 Apr 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2011/01/30/integrating-code-metrics-in-tfs-2010-build.aspx#636991\nHey,\nCould you share the XSD you are using? I generated one from a sample report using the XSD tool, however when I try to deserialize using C#, the System.xml code throws an exception.\n","permalink":"https://blog.ehn.nu/2011/01/integrating-code-metrics-in-tfs-2010-build/","summary":"\u003cp\u003eThe build process template and custom activity described in this post is available here: \u003cbr\u003e\n\u003ca href=\"http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/Inmeta%20TFS%20Build%20Sample.zip\" title=\"http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/Inmeta%20TFS%20Build%20Sample.zip\"\u003ehttp://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/Inmeta%20TFS%20Build%20Sample.zip\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eRunning code metrics has been available since VS 2008, but only from inside the IDE. Yesterday Microsoft finally released \u003ca href=\"http://www.microsoft.com/downloads/en/details.aspx?FamilyID=edd1dfb0-b9fe-4e90-b6a6-5ed6f6f6e615\"\u003eVisual Studio Code Metrics Power Tool 10.0\u003c/a\u003e, a command line tool that lets you run code metrics on your applications.  This means that it is now possible to perform code metrics analysis on the build server as part of your nightly/QA builds. In this post I will show how you can run the metrics command line tool from a build, and also a custom activity that reads the output and appends the results to the build log, and fails the build if the metric values exceeds certain (configurable) treshold values.\u003c/p\u003e","title":"Integrating Code Metrics in TFS 2010 Build"},{"content":"*** The sample build process template discussed in this post is available for download from here: http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/ILMerge.xaml ***\nIn my previous post I talked about library builds that we use to build and replicate dependencies between applications in TFS. This is typically used for common libraries and tools that several other application need to reference.\nWhen the libraries grow in size over time, so does the number of assemblies. So all solutions that uses the common library must reference all the necessary assemblies that they need, and if we for example do a refactoring and extract some code into a new assembly, all the clients must update their references to reflect these changes, otherwise it won’t compile.\nTo improve on this, we use a tool from Microsoft Research called ILMerge (Download from here). It can be used to merge several assemblies into one assembly that contains all types. If you haven’t used this tool before, you should check it out. Previously I have implemented this in builds using a simple batch file that contains the full command, something like this: \u0026quot;%ProgramFiles(x86)%microsoftilmergeilmerge.exe\u0026quot; /target:library /attr:ClassLibrary1.bl.dll /out:MyNewLibrary.dll ClassLibrary1.dll ClassLibrar2.dll ClassLibrary3.dll\nThis merges 3 assemblies (ClassLibrary1, 2 and 3) into a new assembly called MyNewLibrary.dll. It will copy the attributes (file version, product version etc..) from ClassLibrary1.dll, using the /attr switch. For more info on ILMerge command line tool, see the above link.\nThis approach works, but requires a little bit too much knowledge for the developers creating builds, therefor I have implemented a custom activity that wraps the use of ILMerge. This makes it much simpler to setup a new build definition and have the build automatically do the merging. The usage of the activity is then implemented as part of the Library Build process template mentioned in the previous post. For this article I have just created a simple build process template that only performs the ILMerge operation.\nBelow is the code for the custom activity. To make it compile, you need to reference the ILMerge.exe assembly.\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ /// \u0026lt;summary\u0026gt; /// Activity for merging a list of assembies into one, using ILMerge /// \u0026lt;/summary\u0026gt; public sealed class ILMergeActivity : BaseCodeActivity { /// \u0026lt;summary\u0026gt; /// A list of file paths to the assemblies that should be merged /// \u0026lt;/summary\u0026gt; [RequiredArgument] public InArgument\u0026lt;IEnumerable\u0026lt;string\u0026gt;\u0026gt; InputAssemblies { get; set; } /// \u0026lt;summary\u0026gt; /// Full path to the generated assembly /// \u0026lt;/summary\u0026gt; [RequiredArgument] public InArgument\u0026lt;string\u0026gt; OutputFile { get; set; } /// \u0026lt;summary\u0026gt; /// Which input assembly that the attibutes for the generated assembly should be copied from. /// Optional. If not specified, the first input assembly will be used /// \u0026lt;/summary\u0026gt; public InArgument\u0026lt;string\u0026gt; AttributeFile { get; set; } /// \u0026lt;summary\u0026gt; /// Kind of assembly to generate, dll or exe /// \u0026lt;/summary\u0026gt; public InArgument\u0026lt;TargetKindEnum\u0026gt; TargetKind { get; set; } // If your activity returns a value, derive from CodeActivity\u0026lt;TResult\u0026gt; // and return the value from the Execute method. protected override void Execute(CodeActivityContext context) { string message = InputAssemblies.Get(context).Aggregate(\u0026#34;\u0026#34;, (current, assembly) =\u0026gt; current + (assembly + \u0026#34; \u0026#34;)); TrackMessage(context, \u0026#34;Merging \u0026#34; + message + \u0026#34; into \u0026#34; + OutputFile.Get(context)); ILMerge m = new ILMerge(); m.SetInputAssemblies(InputAssemblies.Get(context).ToArray()); m.TargetKind = TargetKind.Get(context) == TargetKindEnum.Dll ? ILMerge.Kind.Dll : ILMerge.Kind.Exe; m.OutputFile = OutputFile.Get(context); m.AttributeFile = !String.IsNullOrEmpty(AttributeFile.Get(context)) ? AttributeFile.Get(context) : InputAssemblies.Get(context).First(); m.SetTargetPlatform(RuntimeEnvironment.GetSystemVersion().Substring(0,2), RuntimeEnvironment.GetRuntimeDirectory()); m.Merge(); TrackMessage(context, \u0026#34;Generated \u0026#34; + m.OutputFile); } } [Browsable(true)] public enum TargetKindEnum { Dll, Exe } NB: The activity inherits from a BaseCodeActivity class which is an internal helper class which contains some methods and properties useful for moste custom activities. In this case, it uses the TrackeMessage method for writing to the build log. You either need to remove the TrackMessage method calls, or implement this yourself (which is not very hard… 🙂)\nThe custom activity has the following input arguments:\nInputAssemblies A list with the (full) paths to the assemblies to merge OutputFile The name of the resulting merged assembly AttributeFile Which assembly to use as the template for the attribute of the merged assembly. This argument is optional and if left blank, the first assembly in the input list is used TargetKind Decides what type of assembly to create, can be either a dll or an exe Of course, there are more switches to the ILMerge.exe, and these can be exposed as input arguments as well if you need it.\nTo show how the custom activity can be used, I have attached a build process template (see link at the top of this post) that merges the output of the projects being built (CommonLibrary.dll and CommonLibrary2.dll) into a merged assembly (NewLibrary.dll). The build process template has the following custom process parameters:\nThe Assemblies To Merge argument is passed into a FindMatchingFiles activity to located all assemblies that are located in the BinariesDirectory folder after the compilation has been performed by Team Build. Here is the complete sequence of activities that performs the merge operation. It is located at the end of the Try, Compile, Test and Associate… sequence:\nIt splits the AssembliesToMerge parameter and appends the full path (using the BinariesDirectory variable) and then enumerates the matching files using the FindMatchingFiles activity.\nWhen running the build, you can see that it merges two assemblies into a new one:\nAnd the merged assembly (and associated pdb file) is copied to the drop location together with the rest of the assemblies:\nComments Imported from the original WordPress site. Closed for new replies.\nMichael Baarz — 12 Jun 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/15/tfs-2010-build-custom-activity-for-merging-assemblies.aspx#581605\nHey,\nnice article. We have a similar hughe heavily used shared libraries which the half is binary and the the other one in solution format. By using TFS 2010 and several team project collections which merging in these libraries we have an heavy payload on referencing needed assemblies. I will try over this weekend your solution with ILMerge, until now it sounds very useful! Great postings, keep on going \u0026hellip;\nRegards, Michael\n","permalink":"https://blog.ehn.nu/2010/12/tfs-2010-build-custom-activity-for-merging-assemblies/","summary":"\u003cp\u003e*** The sample build process template discussed in this post is available for download from here: \u003ca href=\"http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/ILMerge.xaml\" title=\"http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/ILMerge.xaml\"\u003ehttp://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/ILMerge.xaml\u003c/a\u003e ***\u003c/p\u003e\n\u003cp\u003eIn my \u003ca href=\"http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx\"\u003eprevious post\u003c/a\u003e I talked about \u003cem\u003elibrary builds\u003c/em\u003e that we use to build and replicate dependencies between applications in TFS. This is typically used for common libraries and tools that several other application need to reference.\u003c/p\u003e\n\u003cp\u003eWhen the libraries grow in size over time, so does the number of assemblies. So all solutions that uses the common library must reference all the necessary assemblies that they need, and if we for example do a refactoring and extract some \u003cbr\u003e\ncode into a new assembly, all the clients must update their references to reflect these changes, otherwise it won’t compile.\u003c/p\u003e","title":"TFS 2010 Build Custom Activity for Merging Assemblies"},{"content":"Some time ago, I wrote a post about how to implement dependency replication using TFS 2008 Build. We use this for Library builds, 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 is then branched to the applications that need to reference the common library. See the above post for more details.\nOf 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: There is a separate build process template for library builds registered in all team projects \\\nThe following properties are used to configure the library build: \\\nDeploy Folder in Source Control is the server path where the assemblies should be checked in DeploymentFiles is a list of files and/or extensions to what files to check in. Default here is .dll;.pdb which means that all assemblies and debug symbols will be checked in. We can also type for example CommonLibrary.;SomeOtherAssembly.dll* in order to exclude other assemblies You can also see that we are versioning the assemblies as part of the build. This is important, since the resulting assemblies will be deployed together with the referencing application.\nWhen the build executes, it will see of the matching assemblies exist in source control, if not, it will add the files automatically:\nAfter the build has finished, we can see in the history of the TestDeploy folder that the build service account has in fact checked in a new version: \\\nNice! 🙂\nThe implementation of the library build process template is not very complicated, it is a combination of customization of the build process template and some custom activities. We use the generic TFActivity (http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx) to check in and out files, but for the part that checks if a file exists and adds it to source control, it was easier to do this in a custom activity:\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ public sealed class AddFilesToSourceControl : BaseCodeActivity { // Files to add to source control [RequiredArgument] public InArgument\u0026lt;IEnumerable\u0026lt;string\u0026gt;\u0026gt; Files { get; set; } [RequiredArgument] public InArgument\u0026lt;Workspace\u0026gt; Workspace { get; set; } // If your activity returns a value, derive from CodeActivity\u0026lt;TResult\u0026gt; // and return the value from the Execute method. protected override void Execute(CodeActivityContext context) { foreach (var file in Files.Get(context)) { if (!File.Exists(file)) { throw new ApplicationException(\u0026#34;Could not locate \u0026#34; + file); } var ws = this.Workspace.Get(context); string serverPath = ws.TryGetServerItemForLocalItem(file); if( !String.IsNullOrEmpty(serverPath)) { if (!ws.VersionControlServer.ServerItemExists(serverPath, ItemType.File)) { TrackMessage(context, \u0026#34;Adding file \u0026#34; + file); ws.PendAdd(file); } else { TrackMessage(context, \u0026#34;File \u0026#34; + file + \u0026#34; already exists in source control\u0026#34;); } } else { TrackMessage(context, \u0026#34;No server path for \u0026#34; + file); } } } } This build template is a very nice tool that makes it easy to do dependency replication with TFS 2010. Next, I will add funtionality for automatically merging the assemblies (using ILMerge) as part of the build, we do this to keep the number of references to a minimum.\nComments Imported from the original WordPress site. Closed for new replies.\nThomas Eyde — 11 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx#551935\nHow can we automate the merge when we are ready to consume a newer library version? I know there is a command line option, but I keep forgetting what it is. Are there other options?\nJakob Ehn — 13 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx#552275\n@Thomas This can be done using the tf merge command or by implementing a custom activity using the API. The syntax for tf merge is for example:\ntf merge /recursive\nLuc — 28 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx#565269\nIs your template available for download?\nSimon — 28 Nov 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx#601183\nConfused, is this developed from the Default Template, u state \u0026ldquo;There is a separate build process template for library builds\u0026rdquo;, but I only have Default, Upgrade and Lab tempates available to me. Where do you get the library template from?\nTimon — 13 Dec 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx#602598\nHi Jakob. I do actually have the same question as Luc and Simon. Your post looks like the perfect solution for my problem and it would be highly appreciated if you could offer your LibraryBuildProcessTemplate for download! I assume you created it by yourself because it can\u0026rsquo;t find it in my environment either. Cheers\nMagnus Timner — 14 Dec 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx#602715\nHi Jakob,\nThis looks as the perfect solution for me as well! Could you please post your custom template.\n/Magnus\nKen — 12 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx#611856\nOthers have requested a custom template. Can we actually get a FULL solution for this? You completely skip over so many things (how to create the template, how to create the custom activity, how to compile and then reference the activity in order for the template to use it, etc.). Yes, I did follow the link to the TFActivity and read that and downloaded the .zip file, and again\u0026hellip;no instructions on how to actually compile and reference the activity. I can\u0026rsquo;t add it to a new solution and get it to actually build it because Microsoft.TeamFoundation.Build.Workflow is not an option to add through VS2010 even though I know it\u0026rsquo;s on my computer. Even then, I\u0026rsquo;m not sure how to hook up new WorkFlow activities in a template.\nIf I understood TFS Build well enough to apply your solution as it stands on this blog post, I would have been able to write the solution myself and wouldn\u0026rsquo;t have needed to read it.\nThis is one of those things where I need a quick solution that I can understand how to use without needing to understand how it was made. If you want to teach people how you came up with it, you\u0026rsquo;re missing out on vital parts.\n","permalink":"https://blog.ehn.nu/2010/12/dependency-replication-with-tfs-2010-build/","summary":"\u003cp\u003eSome time ago, I wrote a \u003ca href=\"http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx\"\u003epost\u003c/a\u003e about how to implement dependency replication using TFS 2008 Build. We use this for \u003cem\u003eLibrary builds\u003c/em\u003e, 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 \u003cstrong\u003eis\u003c/strong\u003e then branched to the applications that need to reference the common library. See the above post for more details.\u003c/p\u003e\n\u003cp\u003eOf 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: \u003cbr\u003e\nThere is a separate build process template for library builds registered in all team projects \\\u003c/p\u003e","title":"Dependency Replication with TFS 2010 Build"},{"content":"Update 15.03.2014 - Fixed broken link to download\n*** The custom activity is availabe for download here: https://onedrive.live.com/redir?resid=EE034C9F620CD58D%21168 ***\nOften when creating different types of release builds (e.g. where you build something that should be installed or consumed by other applications) there is a need to check in the results of the build back to source control. A common build type for us at Inmeta is Library Builds, which we use for common libraries that are shared among several applications. We have created a special build process template for this scenario that handles versioning, copying of the resulting binaries to a pre-defined folder, optionally merges the assemblies using ILMerge, and finally checking that binaries back to TFS as part of the build.\nWhen it comes to communicating with TFS source control during a build, I find that the most flexible appraoch is to wrap the command line tool tf.exe. This tool has all the functionality you need, and if you choose to implement custom activities for the same functionality you would need to expose a lot of functionality that is very simple to call using tf.exe. There are two major drawbacks of this approach however:\nYou need tf.exe on the build server, e.g. you must install Team Explorer. Generally it is a very good principle to keep the build server as minimal as possible. It is not that easy to invoke command line tools in TFS 2010 Build, it is hard to get the syntax and the paths correct. If you can live with the first drawback, then we can at least reduce the problems of the other drawback by creating a simple custom activity that wraps some of the nitty gritty details of calling tf.exe. This is a simple activity, but I have found it useful and hopefully some of you will too.\nHere is an example of how it looks when it is used in a build process template:\nNote:\nThe property Command is an enum type which just enumerates all possible commands to tf.exe. This makes it easy to select the correct command and stop you from getting syntax errors. The enum is available as well in the download packages \\ You don’t need to know about how tf.exe is called \\ There is an IgnoreError boolean property that will ignore any errors if true (default is false) \\ The Arguments property is the argument to the tf.exe command. In this case, the resulting command will be *tf.exe checkin *.dll /recursive * WorkingDirectory is mapped to the InvokeProcess.WorkingDirectory. Generally when performing source control operations using tf.exe, you should point the working directory somewhere inside the workspace. By doing so, you don’t need to bother about spefcifying workspace or collection URL:s. The custom activity itself is pretty simple, it just wraps the call to InvokeProcess, with the standard output/error logging and error checking:\nThis activity is very simple, and can definitely be exended. Let me know if you find it useful and if you have any suggestions for improvements.\nComments Imported from the original WordPress site. Closed for new replies.\nAaron Kowall — 03 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#545896\nJakob,\nWould you consider submitting your activity to this community project?\nhttp://tfsbuildextensions.codeplex.com/\\\nRené Titulaer — 17 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#552877\nHi, this is exactly what I needed. But I really struggled to get it working. Finnaly I found out that WorkingDirectory should be set to [SourcesDirectory] instead of SourcesDirectory.\nSourcesDirectory appears to be a variable which should be used with brackets\nJakob Ehn — 17 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#552880\n@Rene: If you are using the workflow editor, as in the example above, you only need to type SourcesDirectory. If you look at the underlying XML, then it uses [] to reference workflow variables\nJakob Ehn — 17 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#552881\n@Aaron: Sure, I will add it to the codeplex project.\nNitin — 09 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#605151\nHi Jacob, could you Pl send me the link where custom activity \u0026ldquo;TFActivity\u0026rdquo; is there.\nJakob Ehn — 09 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#605154\n@Nitin: The link is at the top of the blog post :-)\nYéyé — 02 Feb 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#606978\nHi Jacob,\nSourcesDirectory in workflow editor don\u0026rsquo;t works! not declared !\nCould you help me ? :-)\nsachin — 14 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#636320\ncould you Pl send me the link where custom activity \u0026ldquo;TFActivity\u0026rdquo; is there.\nthe Top link is not running now.\nJakob Ehn — 15 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#636340\n@sachin: I have fixed the broken link\nsachin — 15 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#636345\nHi Jakob,\nStill same issue. can u share the custom activity TFActivity on my email id.\nsachin — 15 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#636346\nService Unavailable\nWe are currently experiencing technical difficulties.\nPlease try again later.\nOn top link\nsachin — 15 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#636347\nHi,\nThanks Jacob. Now below link is accessible for me\nhttps://onedrive.live.com/redir?resid=EE034C9F620CD58D%21168\n\\\nsachin — 15 Mar 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/performing-checkins-in-tfs-2010-build.aspx#636356\nHi Jacob,\nInvoked attached custom activity after try compile, Test and assembly activity in Build template but i am getting below error in build.\n3 error(s), 0 warning(s)\nTF14079: The item D:Builds1*.msi is not part of your workspace. Please perform a get operation on this item.\nThere are no pending changes matching the specified items.\nNo files checked in.\nPlease let me know how i can resolve.\n","permalink":"https://blog.ehn.nu/2010/11/performing-checkins-in-tfs-2010-build/","summary":"\u003cp\u003eUpdate 15.03.2014 - Fixed broken link to download\u003c/p\u003e\n\u003cp\u003e*** The custom activity is availabe for download here: \u003ca href=\"http://cid-ee034c9f620cd58d.office.live.com/browse.aspx/BlogSamples?uc=1\" title=\"http://cid-ee034c9f620cd58d.office.live.com/browse.aspx/BlogSamples?uc=1\"\u003ehttps://onedrive.live.com/redir?resid=EE034C9F620CD58D%21168\u003c/a\u003e ***\u003c/p\u003e\n\u003cp\u003eOften when creating different types of release builds (e.g. where you build something that should be installed or consumed by other applications) there is a need to check in the results of the build back \u003cbr\u003e\nto source control. A common build type for us at Inmeta is \u003cem\u003eLibrary Builds\u003c/em\u003e, which we use for common libraries that are shared among several applications. We have created a special build process template \u003cbr\u003e\nfor this scenario that handles versioning, copying of the resulting binaries to a pre-defined folder, optionally merges the assemblies using ILMerge, and finally checking that binaries back to TFS as part of the build.\u003c/p\u003e","title":"Performing Checkins in TFS 2010 Build"},{"content":"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 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:\nThis list is populated with the following build process templates:\nThe ones that come out of the box (DefaultTemplate.xaml, UpgradetTemplate.xaml and LabDefaultTemplate.xaml). These are created for every new team project (this can be changed by modifying the process template) Any build process templates that have previously been added for any other build definitions in the same team project. The last bullet is a bit unintuitive, but it means that if a developer creates a new build definition in team project A, and adds a new build process template (for example by by selecting New and then browse to an existing .xaml file), this build process template will be available in the process dropdown list for all other build definitions in team project A. It will not be available in team project B, but has to be added in the same way.\nManaging Build Process Templates So, how do you manage your build process templates? If you only have a couple of team projects, this night not be a big problem, but if you like us create a team project for every customer this becomes a problem!. We have created a set of default build process templates (CI builds, release builds etc..) that we want to use across all team projects, but this requires developers to know where these .xaml files are located. We do not want to duplicate or branch them unless necessary but instead we store inside a special, internal, team project where all of our software factory related stuff is located.\nFortunately, there is an API that lets you manage build process templates per team project. This API is described by Jason Pricket here http://blogs.msdn.com/b/jpricket/archive/2010/04/08/tfs-2010-managing-build-process-templates-what-are-those.aspx. I have used the source from his blog post to create a custom activity that lets you deploy your build process templates across all team projects using TFS 2010 Build. This means that when you have added a new team project, or a new build process template, you just run the build and it will automatically update all team projects with the build process templates.\n**Custom Activity **The custom activitiy is called DeployBuildProcessTemplates and has 3 parameters:\nBuildProcessTemplates – The list with the source control paths to the build process templates that you want to deploy ExcludeTeamProjects – A list that lets you exclude one or more team projects, in case you do not want to deploy the build process templates to all team projects Workspace – This is the workspace property from the build process template, and is used to retrieve the list of team projects (using the VersionControlServer property) (Note that the custom activity inherits from an internal base class that among other things contain the TrackBuildMessage method which is just a helper method for writing to the build output log)\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ [BuildActivity(HostEnvironmentOption.All)] public sealed class DeployBuildProcessTemplate : BaseCodeActivity { // Define an activity input argument of type string [BrowsableAttribute(true)] [RequiredArgument] public InArgument\u0026lt;StringList\u0026gt; BuildProcessTemplates { get; set; } // Define an activity input argument of type string [BrowsableAttribute(true)] public InArgument\u0026lt;StringList\u0026gt; ExcludeTeamProjects { get; set; } [RequiredArgument] [BrowsableAttribute(true)] // Define an activity input argument of type string public InArgument\u0026lt;Workspace\u0026gt; Workspace { get; set; } // If your activity returns a value, derive from CodeActivity\u0026lt;TResult\u0026gt; // and return the value from the Execute method. protected override void Execute(CodeActivityContext context) { IBuildDetail currentBuild = context.GetExtension\u0026lt;IBuildDetail\u0026gt;(); var vcs = this.Workspace.Get(context).VersionControlServer; foreach (var teamProject in vcs.GetAllTeamProjects(true)) { TeamProject project = teamProject; if( !ExcludeTeamProjects.Get(context).Any(tp =\u0026gt; tp == project.Name)) { // Deploy templates to team project BuildProcessTemplateHelper helper = new BuildProcessTemplateHelper(currentBuild.BuildServer, project.Name); foreach (var processTemplate in BuildProcessTemplates.Get(context)) { if (helper.AddTemplate(processTemplate, ProcessTemplateType.Custom)) { TrackMessage(context, string.Format(\u0026#34;Deployed build process template {0} to team project {1}\u0026#34;, processTemplate, project.Name)); } } } } } } The custom activity just loops through all team projects that are not part of the ExcludeTeamProjects list, and the calls AddTemplate on another class. This method looks like this:\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ public class BuildProcessTemplateHelper { private readonly IBuildServer buildServer; private readonly string teamProject; public BuildProcessTemplateHelper(IBuildServer buildServer, string teamProject) { this.buildServer = buildServer; this.teamProject = teamProject; } public bool AddTemplate(String serverPath) { bool templateAdded = false; var template = GetBuildProcessTemplate(serverPath); if (template == null) { template = buildServer.CreateProcessTemplate(teamProject, serverPath); template.Save(); templateAdded = true; } return templateAdded; } public IProcessTemplate GetBuildProcessTemplate(string serverPath) { IProcessTemplate[] templates = buildServer.QueryProcessTemplates(teamProject); return templates.FirstOrDefault(pt =\u0026gt; pt.ServerPath.Equals(serverPath, StringComparison.OrdinalIgnoreCase)); } } Build Process Template\nTo use the custom activity, just drop it somewhere inside the Run on Agent activity and define the list of build process templates that you want to deploy. Note: The build service account must have the Edit Build Definition permission in all team projects, otherwise it won’t be able to modify this information.\nThe AddTemplate method first checks to see if the build process template already exists, otherwise it adds the path to the list of build process templates for the team project. Rather simple, thanks to Jason for the sample code in his blog post.\nWhen running the build, we can see in the build log which team projects that have been updated:\nComments Imported from the original WordPress site. Closed for new replies.\nBetty — 09 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/11/03/managing-build-process-templates-in-tfs-2010-build.aspx#573077\nYou may not care, but it\u0026rsquo;s fairly easy to recreate your obscured text by overlaying all the rows on top of each other.\n","permalink":"https://blog.ehn.nu/2010/11/managing-build-process-templates-in-tfs-2010-build/","summary":"\u003cp\u003eOne 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 \u003cbr\u003e\nand 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:\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://gwb.blob.core.windows.net/jakob/Windows-Live-Writer/Managing-Build-Process-Templates-in-TFS-_CF49/image_2.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2010/11/managing-build-process-templates-in-tfs-2010-build/23_image_thumb.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eThis list is populated with the following build process templates:\u003c/p\u003e","title":"Managing Build Process Templates in TFS 2010 Build"},{"content":"\nUpdate 2012-01-23: Added note about .NET framework\nMartin Hinshelwood wrote an excellent post recently http://nakedalm.com/team-foundation-server-2010-event-handling-with-subscribers/ ) about a new type of integration 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. 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. 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. 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 server side events.\nThe deployment of a server side event handler couldn’t be simpler, just drop the assembly containing the event handlers into the Plugins folder of TFS, which is located at C:Program FilesMicrosoft Team Foundation Server 2010Application TierWeb ServicesbinPlugins. TFS monitors this directory from any change and will restart itself automatically, so the latest version will always be executed.\nIn this first post on this subject, I will describe how to set up your development environment to make it easy to both deploy and debug your event handler. **Install TFS 2010 **I recommend that you install a local copy of TFS 2010 on your development machine. For this scenario, you only need the Basic version which is a breeze to install. It took me about 10-15 minutes to install and configure it the last time I did it. This will make your TFS development and customization much more efficient than using a share remote server, and you can pretty much assault it as much as you want since it is your private server! 🙂 \\\n**Run Visual Studio 2010 as admin **To be able to deploy your event handler automatically (see next step), you need to run Visual Studio in administration mode \\\n**Create the Event Handler project **To setup the project, create a standard C# class library. Note that the project must be .NET 3.5 (or lower), NOT .NET 4.0 since TFS is running on .NET 2.0 it can’t load a .NET 4.0 assembly in the same app domain. Martin has written about what you need to reference in his post. Since he was using VB.NET in his sample, I thought that I include a C# version of a minimal WorkItemChanged event handler: \\\nCode highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ using System; using System.Diagnostics; using Microsoft.TeamFoundation.Common; using Microsoft.TeamFoundation.Framework.Server; using Microsoft.TeamFoundation.WorkItemTracking.Server; namespace TFSServerEventHandler { public class WorkItemChangedEventHandler : ISubscriber { public Type[] SubscribedTypes() { return new Type[1]{typeof(WorkItemChangedEvent)}; } public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties) { statusCode = 0; properties = null; statusMessage = String.Empty; try { if (notificationType == NotificationType.Notification \u0026amp;\u0026amp; notificationEventArgs is WorkItemChangedEvent) { WorkItemChangedEvent ev = notificationEventArgs as WorkItemChangedEvent; EventLog.WriteEntry(\u0026#34;WorkItemChangedEventHandler\u0026#34;, \u0026#34;WorkItem \u0026#34; + ev.WorkItemTitle + \u0026#34; was modified\u0026#34;); } } catch (Exception) { } return EventNotificationStatus.ActionPermitted; } public string Name { get { return \u0026#34;WorkItemChangedEventHandler\u0026#34;; } } public SubscriberPriority Priority { get { return SubscriberPriority.Normal; } } } } This event handler doesn’t do enything interesting, but just logs information about the modified work item in the event log.\n**Deploy your event handler **Open the project properties and go to the Build tab. Modify the Output Path by browsing to the Plugins directory (see above). This will result in a new deployment of your event handler every time you build. Neat! :-) If you look in the Event log after you compile your project, you will see entries from TFS Services that looks like this:\nAs you can see, TFS has noticed that a new version of the event handler has been dropped in the plugins folder and therefor it is performing a restart. You will notice that TFS becomes temporarily unavailable while this happens. Try modifying a work item and verify that information about it is written in the event log. (Note: You will need to create a event source called “WorkItemChangedEventHandler”, otherwise the EventLog.WriteEntry call will fail.\nDebug the event handler Since these types of events aren’t very well documented it’s useful to debug the event handlers just to find out how your handler is called and what the parameters contain. To do this, to to the Debug menu och select Attach to Process. Check both Show processes from all users and Show processes in all sessions and locate the w3wp process that hosts TFS. Select Attach to start the debugging session. Set a break point in the ProcessEvent method and then modify a work item in TFS. This should cause your event handler to be executed immediately:\nComments Imported from the original WordPress site. Closed for new replies.\nRasheed — 14 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#547417\nHello Jacob:\nThis is very helpful. I\u0026rsquo;m trying to implement a custom check-in event handler and trying to leverage your idea. Our check-in handler should extract some meta data from the checked-in file and push it to application database. I exactly followed your approach for CheckinEvent with no luck. For some reason, it does not break the debug point. However, when I ran your sample for \u0026ldquo;WorkItemChangedEvent\u0026rdquo; is works just fine. Am I missing something? Appreciate your feedback. Please see below the my code:\nusing System;\nusing System.Diagnostics;\nusing Microsoft.TeamFoundation.Common;\nusing Microsoft.TeamFoundation.Framework.Server;\nusing Microsoft.TeamFoundation.VersionControl.Common;\nusing Microsoft.TeamFoundation.WorkItemTracking.Server;\nnamespace TFSServerEventHandler\n{\npublic class CheckinEventHandler : ISubscriber\n{\npublic Type[] SubscribedTypes()\n{\nreturn new Type[1] {typeof(CheckinEvent) };\n}\npublic EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs,\nout int statusCode, out string statusMessage, out ExceptionPropertyCollection properties)\n{\nstatusCode = 0;\nproperties = null;\nstatusMessage = String.Empty;\ntry\n{\n{\nCheckinEvent ev = notificationEventArgs as CheckinEvent;\nEventLog.WriteEntry(\u0026ldquo;ChekinEventHandler\u0026rdquo;, \u0026ldquo;CheckinComment \u0026quot; + ev.Comment );\n}\n}\ncatch (Exception)\n{\n}\nreturn EventNotificationStatus.ActionPermitted;\n}\npublic string Name\n{\nget { return \u0026ldquo;CheckinEventHandler\u0026rdquo;; }\n}\npublic SubscriberPriority Priority\n{\nget { return SubscriberPriority.Normal; }\n}\n}\n}\\\nSubodh Sohoni — 12 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#557629\nExcellent Stuff! I was looking for something similar and your post with Martin Hinshelwood\u0026rsquo;s post gives right directions! Thanks.\nStephen — 20 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#558831\nShould the debugging part work remotely? I setup the remote debugger, but I keep getting \u0026ldquo;no symbols have been loaded for this document\u0026rdquo;.\nChristian — 11 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#562144\nI am trying to get this sample working but for some reason it doesn\u0026rsquo;t seem to fire this event at all. And I used exactly the same code as in the post? Any ideas what might be stopping it? Also trying to remotely debug and breakpoints don\u0026rsquo;t get hit?\nNote for Stephen: have you compiled your plug in in debug and copied the .pdb file over?\nChristian — 11 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#562146\nMe again: ignore the first part of my post from before - i ended up getting it working. I also got the Check in Event working if anyone is interested. Code below - One thing I had to do though to succesfully debug it was put System.Diagnostics.Debugger.Break(); in the code - without it it wouldn\u0026rsquo;t break ever?\nusing System;\nusing System.Diagnostics;\nusing Microsoft.TeamFoundation.Common;\nusing Microsoft.TeamFoundation.Framework.Server;\nusing Microsoft.TeamFoundation.WorkItemTracking.Server;\nusing Microsoft.TeamFoundation.VersionControl.Common;\nusing Microsoft.TeamFoundation.VersionControl.Server;\nnamespace TFSCheckInEventHandler\n{\npublic class TFSCheckInEventHandler : ISubscriber\n{\npublic Type[] SubscribedTypes()\n{\nreturn new Type[1] { typeof(CheckinNotification) };\n}\npublic EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs,\nout int statusCode, out string statusMessage, out ExceptionPropertyCollection properties)\n{\nstatusCode = 0;\n//System.Diagnostics.Debugger.Break();\nproperties = null;\nstatusMessage = String.Empty;\ntry\n{\nif (notificationType == NotificationType.Notification \u0026amp;\u0026amp; notificationEventArgs is CheckinNotification)\n{\nCheckinNotification ev = notificationEventArgs as CheckinNotification;\n}\n}\ncatch (Exception)\n{\n}\nreturn EventNotificationStatus.ActionPermitted;\n}\npublic string Name\n{\nget { return \u0026ldquo;TFSCheckInEventHandler\u0026rdquo;; }\n}\npublic SubscriberPriority Priority\n{\nget { return SubscriberPriority.Normal; }\n}\n}\n}\n\\\nLeo — 18 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#563542\nin the case i need to deny the event (EventNotificationStatus.ActionDenied), it is possible to give to the user a custom message??\nVaccano — 20 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#563744\nThanks for the Post. I was able to use your stuff combined with Martin\u0026rsquo;s to make my own aggregation code.\nI posted it on codeplex here: http://tfsaggregator.codeplex.com/ if any one else is interested\nBruce Cutler — 20 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#574786\nHow can I tell what type of work item is being modified?\nAlex — 20 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#590584\nLibrary is loading but did not work on event. What can it be? Configuration TFS SP1 RU. I am trying CheckinNotification and WorkItemChangedEvent.\nRichard Roberts — 05 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#596000\ngreat information but I am getting errors when my component tries to access and read an element in a app.config file.\nConfigurationManager.AppSettings[\u0026ldquo;somekey\u0026rdquo;]; Any Ideas why?\nBill Lock — 11 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#605350\nI was able to successfully record all the CheckinNotification properties to a file when a checkin was performed on TFS via a custom plugin. (thanks)\nCurrently I want to know the project name of the checkin. I currently preface the comment with the project name, but I am looking for an automatic way of retrieving this information.\nIf anyone has any ideas please let me know.\nHave a great day!\nBill\\\nJakob Ehn — 23 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#606238\n@Bill: Do you mean the Team Project name or the VS project that the file is included in?\nJakob Ehn — 23 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#606239\n@Richard: You is no application configuration file associated with a server side event handler, since it is hosted inside TFS. If you need configurablility, you need to resort to either the Windows or the TFS registry\nJakob Ehn — 23 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#606240\n@Alex, see my note about .NET Framework, that one bit me recently\nLilia — 09 Feb 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#607465\n@Jakob I am also looking for the same info as @Bill - I can\u0026rsquo;t figure out how to get the Team Project name programmatically from in the CheckinNotification scenario. Any ideas? Thanks\nDino — 10 May 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#613474\nI followed the steps you listed but when I try to debug the code by attaching to the process, I get the following error eventhough the project is .NET 3.5.\n{\u0026ldquo;Microsoft SharePoint is not supported with version 4.0.30319.261 of the Microsoft .Net Runtime.\u0026rdquo;}\nI have tried creating new project from scratch to make sure it is .NET 3.5 based, but it gives same error.\nAny idea or suggestion?\nVel — 18 Jul 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#616676\nHi Jakob,\nI am working with event handler for extracting check-in information and was able to develop and dropped in plugins, but I would also require additional info such as check-in filename, project name od check-in file, etc.\nany kind of help on this would be really greatly appreciated Mr. Jakob.\nThanks\nRajesh — 24 Aug 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#618255\nThanks a lot. This really helped me\u0026hellip;\nrayco — 24 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#620720\nWork this ISubscriber event even on TFS 2012?\nJakob Ehn — 24 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#620721\n@Rayco: Yes it does, in fact I recently updated the source on CodePlex with a TFS 2012 version. I will add a note in this post about that\nJakob Ehn — 24 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#620722\n@Rayco: Yes it does, you just need to compile against the TFS 2012 assemblies and it will work just fine\nRayco — 26 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#620809\nthanx, i recompiled with tfs2012 asseblies and works fine!\nSriharsha — 06 Nov 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#621156\nhow to call the ProcessEvent method by giving the details of my work items.. Pls explain.\nNico — 31 Jan 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#624560\nwhere can I get those 2012 assemblies? We have a 2010 production server but we plan to migrate soon so I installed a tfs 2012 express on my dev machine. But your example doesn\u0026rsquo;t work against that version when compiled with 2010 assemblies. Unfortunately I cannot find the needed assemblies on my local server. Maybe because it\u0026rsquo;s an express version?\nJakob Ehn — 31 Jan 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#624561\n@Nico: If you look at the codeplex site, the Main branch is compiled against the TFS 2012 assemblies. The assemblies are typically located at;\nC:Program FilesMicrosoft Team Foundation Server 11.0Application TierWeb Servicesbin\nPeter — 14 Mar 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#626066\nIndeed a good article Recently I have tested a tool called Lepide Event Log Manager its really a nice management of all event log in your machine Check it once you will surely like its functionalities http://www.windowseventlogmonitor.com/\nHardik — 28 Aug 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#631624\nHi, Thats an awsome article. i have used your code and i am able to use TFS Plugins. That works as expected. But when i upload TFS plugins, Other TFS Users start facing performance problem while using TFS.\nThey get TFS running very slow.\nSo what could be the reason behind this ? Regards\nHardik\nDany — 29 Oct 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#633106\n@hardik\nA TFS Server plug-in works synchronous. So when you do a lot of stuff in your plug-in then you are getting Performance Problems.\nsuresh — 02 Jan 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#634645\nit was a good article.\nI have sued this in my sample application and here is what I need.\nIma ble to capture events, but only after saving the work item.\nSo when I change a state from new to close and click save, the event is fired. But the work item is already saved, and history for the work item is logged. now the event handler changes the status from close to new, due to some business logic, and again the history is logged. I would like to eliminate two history events, which would confuse the developer.\nIt typically means, I should not be capturing the workitem event, but event of the field. in my case status field on change. Let me know if any one has any insight in this direction. Any help is appreciated.\nSumukh — 13 Jun 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#638340\nHi Jacob,\nThanks for this article. I wanted to ask if this is possible with Java SDK for TFS? My end goal is to call a external web service when a work item is changed in TFS. Is this possible through Java SDK provided by Microsoft? Please HELP.\nThanks.\nFaith — 26 Jun 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#638539\nFor TFS 2012, where would the Plugins folder of TFS be? I can\u0026rsquo;t find anything even remotely like that for 2010 on my server, but really need it to work on 2012 and 2013\u0026hellip;\nThanks,\nFaith\nJakob Ehn — 18 Nov 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#641458\n@Faith: For TFS 2013, the folder is located at C:Program FilesMicrosoft Team Foundation Server 12.0Application TierWeb ServicesbinPlugins\nFor TFS 2012, replace 12.0 with 11.0\n\\\nJakob Ehn — 18 Nov 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#641459\n@sumukh: This technique is not possible using Java, but you can use the standard alert mechanism in TFS by invoking a SOAP web service when a work item is changed.\nSee http://msdn.microsoft.com/en-us/magazine/cc507647.aspx for some details on this\nDong nGuyen — 05 Aug 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx#645661\non TFS 2015 requestContext.GetService() =\u0026gt; alway null. Can you help me fix it ?\n","permalink":"https://blog.ehn.nu/2010/10/developing-and-debugging-server-side-event-handlers-in-tfs-2010/","summary":"\u003cp\u003e\u003cbr\u003e\n\u003cstrong\u003eUpdate 2012-01-23: Added note about .NET framework\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://geekswithblogs.net/hinshelm/Default.aspx\"\u003eMartin Hinshelwood\u003c/a\u003e wrote an excellent post recently  \u003ca href=\"http://nakedalm.com/team-foundation-server-2010-event-handling-with-subscribers/\"\u003ehttp://nakedalm.com/team-foundation-server-2010-event-handling-with-subscribers/\u003c/a\u003e ) about a new type of integration \u003cbr\u003e\navailable 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. \u003cbr\u003e\nPreviously, 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. \u003cbr\u003e\nUsually 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. \u003cbr\u003e\nThe 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 \u003cbr\u003e\nserver side events.\u003c/p\u003e","title":"Developing and debugging Server Side Event Handlers in TFS 2010"},{"content":"In TFS 2010, branching and merging have been greatly improved with support for branch visualization and tracking of changesets and work items across branches. A simple example of this looks like this: \\\nHere we track Work Item nr 3 which was originally resovled in the Test branch (with changeset 35). We can also see that the work item has been merged into the Production branch (as changeset 37), back to Main (62) and finally to FeatureC (140). If we switch to the Timeline view, we get a nice view of the order of these merges, together with the dates.\nUnfortunately, this does not solve one of the bigger problems when it comes to branches and work items. When you merge your changes into another branch, you must remember to asociated the corresponding work item again, otherwise that information is lost and the work item will not show up in the build report from the builds running off the target branches. A typical example is that we have 3 bugs in the Test branch, and we perform (at least) 3 changesets and each changeset is associated to the corresponding work item. When it is time to merge the bug fixes to the Production branch, we must manually associated the merge with the work item again**.** If we peform one merge operation that brings all changes from Test to Main, we must associate all 3 work items. There is really no support for “merging” work items across branches in TFS, only changesets can be merged.\nWhat you really want is to have the tool automatically assign the work items that were associated with the changesets that you are merging. One way to implement this is with a checkin policy, which we have done at our company. The reason for choosing a checkin policy as the tool of choice is because it is executed on the client at the time of the checkin, and we can display the work items to the developers before they check in.\nSo, how does it work? Lets look at an example: In my development branch, I have 3 bugs (Bug1, Bug2 and Bug3) that I need to fix. I fix each one in a changeset that gets checked in and associated with the corresponding work item. Then it is time to merge the fixes to the Main branch (trunk). I perform a merge by just using the normal Merge operation from source control. This leaves me with the following pending merge:\nNow, I would normally go to the Work Items tab and link to the work items that I know were resolved by the changes that I am currently merging. But now I don’t need to do this but instead I just click on the Check In button. This will evaluate all checkin policies, and one of them is the Merge Work Items policy that pops up the following dialog:\nThis dialog shows me a list of the work items that were associated with the changesets that I am currently merging in. The checkin policy uses the TFS Version Control API to locate the merge sources of each pending merge item and basically shows the union of these work items (several changesets can be associated with the same work item). If I check in now, the changeset will automatically be associated with these 3 work items! The beauty of this comes when running the builds off the Main branch, the build summary show me that these 3 work items have been resolved in this build:\nIn another post I will show the interesteing parts of the implementation\nComments Imported from the original WordPress site. Closed for new replies.\nEd Blankenship — 27 Oct 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#544831\nYou could also create a workflow activity that will look at the associated changesets and check to see which changesets were merged into it and grab those work items. You can do it recursively even across multiple branches if you wanted to.\nI have done this to create release notes in the MAIN branch\u0026rsquo;s build to get the original changesets with the original work items that were associated with them. This prevents you from having to associate merge changesets with the original work items.\nAlso - Track Changes on the Work Item (right-click work item form and choose Track Work Item) works correctly without having to associate merge changesets with the work item as well.\nJakob Ehn — 27 Oct 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#544912\nCheers Ed, I have actually included this functionality in a custom build activity as well. I wanted to try to use a checkin policy first to see how it works, but we might move to a solution where this is done by the build instead. What I like about this solution is that you get confirmation about the changes that you are currently merging before checkin in. Often the changeset information is not enough.\nRussell — 02 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#550432\nThis is EXACTLY what I am looking for.\nCan you share the source for this policy?? or zip it and mail it to me?\nMichael Dang — 08 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#551335\nThis is great. Could I get the policy or source too please? Email?\nMike Paterson — 13 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#552163\nI agree. Where\u0026rsquo;s the source code and/or assemblies for this gem?\nMike\nAaron — 21 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#553617\nDo you plan to share the implementation details for this policy?\nEd Blankenship — 23 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#554032\nIf you are interested in a \u0026ldquo;release notes\u0026rdquo; activity as mentioned in the comments, feel free to vote on the activity request backlog item included in the Community TFS Build Extensions CodePlex project: http://tfsbuildextensions.codeplex.com/workitem/6382\nBrandon — 26 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#559658\nHow can I use this?\nJon — 10 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#577387\nI would like to see this check in policy as well. Looks very useful.\nJay — 11 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#577506\nNice job posting what you did without explaining HOW you did it.\nAtila Arel — 13 Jun 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#581786\nYou have to enable the policy on the team project, you can do this by right clicking the team project in the Team Explorer and select Source Control. Then download and install the Team Foundation Power Tools and you are good to go.\nPeter Heasler — 12 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#585358\nIf you\u0026rsquo;re looking for the subsequent post, it\u0026rsquo;s here: http://geekswithblogs.net/jakob/archive/2011/05/17/automatically-merging-work-items-in-tfs-2010.aspx\nAtul — 03 Feb 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#624657\nHi Jakob,\nAfter searching the net for a long time,most of the links are pointing to your blog so I here I am requesting for your help in similar scenario.\nWe have a Development branch \\\nGroup1 branch created from Development \\ Group2 branch created from Development Now when I am trying to merge my changes i.e. Source as Group1 I get 2 options to select Target location which is Group2 and Development\nI want to create some custom check in policy or something like that which will restrcit to merge in Development from Group1 I want to force the user to merge into Group2 only and from Group2 to Development.\nI have crated the structure of my check in policy but not sure what condition to write to get this check..Any help is really appreciated.\n\\ Bruno Bertechini — 18 Sep 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/27/merging-work-items-in-tfs-2010.aspx#646270\nHello there, well done fantastic job!\nI cant find the Track Work Item feature.\nOnly Track Changeset\nWhere can I find it please !\nThank you very much\nBruno\n","permalink":"https://blog.ehn.nu/2010/10/merging-work-items-in-tfs-2010/","summary":"\u003cp\u003eIn TFS 2010, branching and merging have been greatly improved with support for branch visualization and tracking of changesets and work items across branches. A simple example of this looks like this: \\\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://gwb.blob.core.windows.net/jakob/Windows-Live-Writer/Merging-Work-Items-in-TFS-2010_12A4F/image_6.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2010/10/merging-work-items-in-tfs-2010/22_image_thumb_2.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://gwb.blob.core.windows.net/jakob/Windows-Live-Writer/Merging-Work-Items-in-TFS-2010_12A4F/image_19.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2010/10/merging-work-items-in-tfs-2010/7_image_thumb_7.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eHere we track Work Item nr 3 which was originally resovled in the Test branch (with changeset 35). We can also see that the work item has been merged into the Production branch (as changeset 37), back to Main (62) and finally to FeatureC (140). \u003cbr\u003e\nIf we switch to the Timeline view, we get a nice view of the order of these merges, together with the dates.\u003c/p\u003e","title":"Merging Work Items in TFS 2010"},{"content":"In TFS 2010, I have been asked this question several times: I have a build setup with tests and (possibly) code coverage, but in the build summary report it only shows No Test Results and No Code Coverage Results\nWhat’s more interesting is that when I log in and view the build, I can see the test results!\nThis does of course imply that it is a one of those annoying security issues, and of course it is. To be able to see test results you must have the View Test Runs permission, which can be assigned/revoked at the security group level per team project:\nSo make sure that you set this permission for your developers, if you want them to be able to see the test results (tip: you want that!)\nComments Imported from the original WordPress site. Closed for new replies.\nStefano Torelli — 01 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/06/why-canrsquot-i-see-test-results-in-the-tfs-2010.aspx#550254\nI have the same problem even if I am a full administrator of TFS 2010 so the \u0026ldquo;View test runs\u0026rdquo; permission is granted by default. By the way if I use the link provided by the email alert (automatically sent by the system, if it is configured to do so) I can access the web report of the given build which contains either the test results report and the code coverage report.\nAny one have solved the problem while dealing with the visual studio report?\nToby — 16 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/10/06/why-canrsquot-i-see-test-results-in-the-tfs-2010.aspx#552687\nThanks for posting!\n","permalink":"https://blog.ehn.nu/2010/10/why-cant-i-see-test-results-in-the-tfs-2010-build-report/","summary":"\u003cp\u003eIn TFS 2010, I have been asked this question several times: I have a build setup with tests and (possibly) code coverage, but in the build summary report it only shows \u003cstrong\u003eNo Test Results\u003c/strong\u003e and \u003cstrong\u003eNo Code Coverage Results\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWhat’s more interesting is that when I log in and view the build, I can see the test results!\u003c/p\u003e\n\u003cp\u003eThis does of course imply that it is a one of those annoying security issues, and of course it is. \u003cbr\u003e\nTo be able to see test results you must have the \u003cstrong\u003eView Test Runs\u003c/strong\u003e permission, which can be assigned/revoked at the security group level per team project:\u003c/p\u003e","title":"Why can’t I see test results in the TFS 2010 Build Report?"},{"content":"Note: Swedish post\nEfter att ha kört många seminarier, workshops och deep dive kurser på Visual Studio och TFS 2010 i Norge är det nu äntligen dags för oss att köra kurs i Sverige!\nFörsta tillfället blir nu i oktober på Cornerstone 18-21 Oktober. Saxat från kursbeskrivningen:\nT359 - Effektiv systemutveckling med Visual Studio och Team Foundation Server 2010 I denna utbildning lär vi dig hur du och din organisation kan effektivisera systemutvecklingsprocessen med hjälp av Visual Studio och Team Foundation Server. Målgruppen för denna kurs är främst utvecklare och arkitekter men den är lämplig även för testare och den som ansvarar för metoder och processer.\nDu lär dig Du lär dig att jobba effektivt med bland annat källkodshantering, branching, change tracking, work items, automatiska byggen, tester och mycket annat.\nÄmnesområden Introduktion/Arkitektur \u0026ldquo;Lap around TFS\u0026rdquo; Source Control Branching/Branch Visualization Branching scenarios och hur dessa implementeras i TFS Change tracking, hur man kan spåra vilka ändringar (work items) som har blivit mergade till olika branches Checkin Policies Deployment/Uppgradering Work Items Introduktion Genomgång av de vanligaste TFS process templates (MSF Agile/CMMI, MS Scrum, Scrum for Team System.) Work Items Customization TFS Process Templates och Process Guidance Team Foundation Build Overview/Arkitektur Build Controllers/Build Agenter Windows Workflow 4.0 Uppgradering från TFS 2005/2008 Test Overview/Arkitektur Test planer, Test Suites och Test Cases Microsoft Test Manager (MTM) Test Automation TFS Customization/Extensibility TFS Events TFS API Anmäl er här:\nhttp://www.cornerstone.se/Web/Templates/CoursePage.aspx?id=2513\u0026amp;course=COUR2010083117182403594425\u0026amp;epslanguage=SV\nVi ses där! :-)\n","permalink":"https://blog.ehn.nu/2010/09/tfs-2010-deepdive-i-stockholm-i-oktober/","summary":"\u003cp\u003e\u003cstrong\u003eNote: Swedish post\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eEfter att ha kört många seminarier, workshops och deep dive kurser på Visual Studio och TFS 2010 i Norge är det nu äntligen dags för oss att köra kurs i Sverige!\u003c/p\u003e\n\u003cp\u003eFörsta tillfället blir nu i oktober på Cornerstone 18-21 Oktober. Saxat från kursbeskrivningen:\u003c/p\u003e\n\u003ch3\u003e\u003c/h3\u003e\n\u003ch3 id=\"t359---effektiv-systemutveckling-med-visual-studio-och-team-foundation-server-2010\"\u003eT359 - Effektiv systemutveckling med Visual Studio och Team Foundation Server 2010\u003c/h3\u003e\n\u003cp\u003eI denna utbildning lär vi dig hur du och din organisation kan effektivisera systemutvecklingsprocessen med hjälp av Visual Studio och Team Foundation Server. Målgruppen för denna kurs är främst utvecklare och arkitekter men den är lämplig även för testare och den som ansvarar för metoder och processer.\u003c/p\u003e","title":"TFS 2010 DeepDive i Stockholm i oktober"},{"content":"By default, TFS Team Build creates a new folder in the drop location for every build. I have seen request from people that wonder how to always have team build put the output in the same folder every time, effectively overwriting the results from the last build. This is easy to accomplish by adding an activity that copies the drop folder to a fixed location.\nTo copy the result of the build to a fixed location, you need to modify the build process template:\nOpen the build process template XAML file in the workflow designer. \\ Click on the Collapse All link in the upper right corner so that only the top level activities are shown \\ Open the Toolbox window and locate the CopyDirectory activity (it is located in the Team Foundation Build Activities tab) \\ Drag the CopyDirectory activity onto the design surface and drop it between the Run On Agent and the Check In Gated Changes for CheckInShelveset Builds activity: \\ Right click on the CopyDirectory activity and select Properties. Fill out the properties, you will of course need to modify the path for the destination accordingly: \\ Save the build definition and check it in. NB: Remember to check in the build process template file after modifying it, a lot of times people forget this step! \\ Queue a new build and, after the build has succeeded, verify that the build output has been copied to the corresponding output path To make this build process template more generic, you proabably want to create a process parameter that lets you define the path either when you create a new build definition, or when you queue the build (or both). This will let you you reuse the build process template for builds with different output paths\nComments Imported from the original WordPress site. Closed for new replies.\nTim — 11 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#547050\nI am getting \u0026ldquo;Access Denied\u0026rdquo; errors using this CopyDirectory task. Essentially the task is unable to write to the other server in my case. Is this a result of the TFSBuildServiceHost running under \u0026lsquo;Network Service\u0026rsquo; account? What security settings are required on the \\ServerPathSomeShare folder?\nJakob Ehn — 14 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#547402\nYou must give the build service account permission to write to the share. Normal Write/Modify ACL permissions is enough\ntikra — 08 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#561618\nThanks. Exactly what I was looking for. :)\nshamsheer — 25 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#570159\nWe are using WIX which creats an MSI cabinate that contains all dll\u0026rsquo;s and files that copies to DROP Location. Now my need is to copy the same content of the MSI file to the drop location (Not as a cabinate) when the build get succeded.\nAny help wolud be appriciated.. Thanks in Advance. :)\ngout symptoms — 02 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#576434\nIt was very well laid out and helpful. Thanks Jakob!\nAnanya — 06 Sep 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#592643\nI tried this, but did not work, only log file was available at the drop location I specified, the buildversionlabel.xml file was in C:Builds5productproduct_NightlySourcesA3CommonComponentsRemoteServerSourceA3.Common.Components.RemoteServer\nNaveen Sharma — 20 Mar 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#610659\nYou are the man! Was looking for some guidance on this, where can I get better build guidance than here :)\nWorked for us!!!\nAndrey — 14 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#619023\nWhy can\u0026rsquo;t i set a normal physical path (e.g. D:WebSitesMyWebSite) for the build output? I have TFS and web sites on the same machine and i need to copy my build output files just to another directory on the same machine. But i can\u0026rsquo;t make it because i can set my drop directory only in the Visual Studio project properties that accepts only UNC paths\u0026hellip;Do i need to use some custom publishing actions to copy my build output from default build folder to the www root of my IIS web sites?\nJakob Ehn — 14 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#619028\n@Andrey: You must enter a share as the output path, Team Build won\u0026rsquo;t accept anything else. I suggest that you just create a share on the server that points to the web site folder in IIS\n/Jakob\nAndrey — 14 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#619032\n@Jakob - ok, i\u0026rsquo;ve shared a website root and set it as a drop folder for the TFS build configuration. Is it enough to \u0026ldquo;publish\u0026rdquo; a build output on my web site (ASP.NET MVC project)\nJakob Ehn — 14 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#619033\n@Andrey: No, team build will create a new drop folder beneath the drop location on every build. This post describe how you can take the output from the drop folder and copy it to a fixed location, which basically is what you need.\nAnother option for you, since you are developing web apps, is to use web deploy to publish your web application. If you are using VS2012, create a publish profile and check it in, then add this to the MSBuild Arguments parameter in your build definition:\n/p:DeployOnBuild=true;PublishProfile=\u0026ldquo;MyPublishProfileName\u0026rdquo;\nHope that helps\\\nAndrey — 14 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#619054\n@Jakob - thanks a lot, it works. Although i can\u0026rsquo;t guess why TFS doesnt support a simple copying of the build output to the any folder on the local file system\u0026hellip;\nThanks again, you really helper me!\nAncc — 18 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#620341\nJakob,\nI am trying to deloy WCF service of .net in TFS2012 using build defination and useed below args in msbuild in the arguments /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=InProc /p:MSDeployServiceUrl=win-gs9gmujits8 /p:DeployIISAppPath=\u0026ldquo;Sites/Website name\u0026rdquo;\nbut thi is not deplying the published folder on iis virtual shared directoy although there is no error reported . so i used your copydietcory approach to manually copy it to shared IIS virtual directory after build , but is there more smart way to do it rathet tahn creating new template for this for diffrent build ?\nalso i dont want all files under _PublishedWebsites folder as thet are web.config and other xml files also which are created and i want to exlude them and coply only bin and servrice folder to IIS , so do i need as many diffrent copydirectot task in defination to give source as _PublishedWebsitesbin, _PublishedWebsitesXXXX and ,_PublishedWebsitesYYYY folder separtely or is there much easier and better way to achive this ?\nAny help is well appreciated .\nJan Sokoly — 25 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#620747\nAppreciate your post, it\u0026rsquo;s exactly what I\u0026rsquo;ve been looking for.\nI\u0026rsquo;ve made a slight modification though. As we use multiple build definitions, I use\nBuildDetail.DropLocationRoot + \u0026ldquo;latest\u0026rdquo;\nas the Destination to keep the latest source with appropriate build definition outputs.\nShota Giorgobiani — 26 Nov 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#621941\nI can\u0026rsquo;t even express how graceful I am! I spent several days to overcome this problem and at last got your solution. Thank\u0026rsquo;s a lot!\nAbraham Dhanyaraj — 01 Mar 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#625611\nAmazing,\u0026hellip; Thanks a lot for this.. :)\nVikas Gupta — 26 Jul 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#631003\nHow about simply modifying the BuildNumberFormat vallue From: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)\nTo: $(BuildDefinitionName) or any other fixed name. So, every time the build runs it will dump the final output to the same folder under the UNC drop location path\nVikas Gupta — 26 Jul 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#631004\nSorry, the above solution will not work as the build engine needs a unique name for every build.\nSteve — 13 Sep 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#632027\nAs mentioned in a previous post (for which I didn\u0026rsquo;t see a reply), I need to exclude the web.config from CopyDirectory. \u0026ldquo;Exclude\u0026rdquo; was supported in the TFSBuild.proj AfterDropBuild script. Why doesn\u0026rsquo;t CopyDirectory support exclusion?\nGanesh — 05 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#635477\nVery nice and Helped a lot\nHardy — 27 Jun 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#638567\nI am looking for the same and this post helped, Thanks.\nIn addition to this, I am looking to create 4 sub-folders at the destination for my 8 projects in the solution. What is the recommended way to do this. Based on it, I have two question:\\\nShould I use CreateDirectory and CopyDirectory activities. OR use arguments in MSBuild. \\ In the example source of Copy is the DropLocation. As per my understanding build server makes a copy of source and build files. So isn\u0026rsquo;t it a good idea to copy files directly from Build Server (something like $build folderbin) to \\ServerPathSomeShare. Currently, I don\u0026rsquo;t know how to do this, but if kindly provide info if you know how to do it.\nThanks\nHardy Jonathan Siqueira — 12 Jul 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#638786\nHi Everyone,\nI am trying an TFS autobuild continous integration. When a developer checks in the code, the build definition executes the code and Drops the publish files to a Location with build numbers incrementally. once the Code is checked in, i would like the build defination to delete the old publish files and deploy the new publish file to the same location of the drop location, Am doing this because my drop location is mapped to iis virtual directory, does any one have a better solution.\n\\\nJonathan Siqueira — 14 Jul 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#638824\nHi,\nAfter I do a new build using the build definition, I get the _PublishWebsite folder created. i want to get rid of the _Publishwebsite folder and directly copy all the dll and cshtml files to the Root folder.\nPlease suggest\nAbin — 25 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx#644958\nHi ,\nI am not able to copy the files to another server path (UAC).. Even that shared folder has full permission for everyone. I am getting some user name and password is incorrect error. Is there any option to provide credentials in CopyDirectory property.\nI tried to copy to another folder in the build server and it is working fine.\nplease check the build log;\nDrop Files to Drop Location\n00:00\nCopyPublish\nException Message: The user name or password is incorrect.\n(type IOException)\nException Stack Trace: at Microsoft.TeamFoundation.Build.Workflow.Activities.WindowsDropProvider.EndCopyDirectory(IAsyncResult result)\nat Microsoft.TeamFoundation.Build.Workflow.Activities.CopyDirectory.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)\nat System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)\\\n","permalink":"https://blog.ehn.nu/2010/09/tfs-team-build-2010-how-to-place-the-build-output-to-a-fixed-location/","summary":"\u003cp\u003eBy default, TFS Team Build creates a new folder in the drop location for every build. I have seen request from people that wonder how to always have team build put the output in the same folder every time, effectively overwriting the results from the last build. This is easy to accomplish by adding an activity that copies the drop folder to a fixed location.\u003c/p\u003e\n\u003cp\u003eTo copy the result of the build to a fixed location, you need to modify the build process template:\u003c/p\u003e","title":"TFS Team Build 2010: How to place the build output to a fixed location"},{"content":"Recently I’ve come across this error a couple of times when running builds that exeucte unit tests using Test containers:\nAPI restriction: The assembly \u0026lsquo;file:///C:Buildsmyassembly.dll\u0026rsquo; has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.\nEvery time I’ve got this error, the project has been a web application, and the path to the assembly points down to the _PublishedWebsites directory that is created beneath the Binaries folder during a team build.\nThe error description really says it all (although slightly cryptic), when using test containers, MSTest needs to load all assemblies and see if they contain any unit tests. During this serach, it finds the ‘myassembly.dll’ in two different locations. First it is found directly beneth the Binaries folder, and then it is alos found beneath the _PublishedWebsitesProjectbin folder. The reason is that the default setting for test containers in a TFS 2010 build definition is **test.dll:\nThis pattern means that MSTest will search recursively for all assemblies beneath the Binaries folder, and during the search it will find the MyAssembly.dll twice. The solution is simple, set the Test assembly file specification property to test.dll instead, this will disable the recursive search:\nComments Imported from the original WordPress site. Closed for new replies.\nafsharm — 08 Jun 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#523278\nIt worked for me. tnks!\nAfshar Mohebbi — 17 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#533545\nThanks Jakob. Your solution solved my problem too. I had a web project named \u0026ldquo;WebTest\u0026rdquo; that contained no unit test.\nSuneel — 31 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#535636\nThanks for the solution. it worked\u0026hellip;:)\nVijay — 27 Oct 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#544810\nThanks. It solved my problem too.\narchpulse — 26 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#549367\nJakob\u0026rsquo;s post helped me look at the right places for the problem. But there is more to this problem then just the above fix. Visit my blog at\nhttp://archpulse.wordpress.com/2010/11/24/tfs-2010-customize-build-output-changes-and-ms-tests/\nLook at the tailend for possible other causes of this issue.\nWamiq Ansari — 18 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#568932\nGreat solution!, Thank you.\nJonathan Mc Namee — 04 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#576684\nit took me ages to figure out how to apply this setting, I couldn\u0026rsquo;t find the dialog in the screenshot above. I eventually changed it by doing the following:\n1: Open Team Explorer\n2: Expand tree until you see builds for your project\n3: Select the build in question\n4: Right Click \u0026gt; Edit Build Definition\n5: Click \u0026lsquo;Process\u0026rsquo; on side bar on left\n6: Expand \u0026lsquo;2. Basic\u0026rsquo; \u0026gt; Automated tests\n7: Modify value or delete altogether if needs be\nVijay — 26 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#591357\nThanks for the post, helped quickly to resolve the issue.\nDAvid sundström — 29 Sep 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#595438\nThanks Jakob, in my case we included a dll called JSTest.dll for unit-testing javascripts\u0026hellip;\nShashank — 03 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#604610\nThank you so much its great.\nWayneRazor — 20 Mar 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#610646\nExcellent explanation and great solution, Thanks.\nTo Jonathan Mc Namee:\nThe place to apply this setting is actually in your project build definition, right click \u0026ldquo;your build definition\u0026rdquo;, \u0026ldquo;Edit build definition\u0026hellip;\u0026rdquo;, click \u0026ldquo;Process\u0026rdquo;, the setting is in \u0026ldquo;2 Basic\u0026rdquo; - \u0026gt; Automated Tests\nMarco — 19 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#612252\nGreat, thanks a lot!\nPawan — 01 May 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#612976\nThis worked for me. Thank you.\nAzhar — 17 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#619097\nWell done , it worked for me as well\nHamid — 03 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#619786\nMany thanks,\nI was getting this error and the solution in your post solved it.\\\nCraig — 04 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#619827\nAhh, I had a project named \u0026lsquo;datatest\u0026rsquo; that had no tests in it. Nice find.\nDave — 09 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#619988\nThank you, worked for me.\nGhyath — 23 Dec 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#622990\nThank you, Worked for me also\nRaviS — 25 Feb 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#625418\nThanks. Worked for me.\nHarishwar — 16 May 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#628748\nCool.. this helped me to get through the error.\nSreeni — 27 Apr 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#644002\nIt worked for me for VS 2013 too. Thank you.\nAndrew — 25 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx#644986\nI am using VS2013 and same issue with API restriction error.\nI cannot find project build definition.\nSolution Explorer shows tree of project.\nIs that the place to find definition ?\n\\\nEkir Atari — 12 Jan 2018\n2018 and this is still fixing things\u0026hellip;\n","permalink":"https://blog.ehn.nu/2010/06/tfs-2010-build-dealing-with-the-api-restriction-error/","summary":"\u003cp\u003eRecently I’ve come across this error a couple of times when running builds that exeucte unit tests using Test containers:\u003c/p\u003e\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003eAPI restriction: The assembly \u0026lsquo;file:///C:Builds\u003cpath\u003emyassembly.dll\u0026rsquo; has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.\u003c/strong\u003e\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eEvery time I’ve got this error, the project has been a web application, and the path to the assembly points down to the _PublishedWebsites directory that is created beneath the Binaries folder during a team build.\u003c/p\u003e","title":"TFS 2010 Build: Dealing with the API restriction error"},{"content":"UPDATE: 2010-09-15 – Added details about the use of the ExitCode variable\nOne of the most common complaints from people starting to use Team Build is that is doesn’t support building Microsoft’s own Setup and Deployment project (*.vdproj). When creating a default build definition that compiles a solution containing a setup project, you’ll get the following warning:\nThe project file \u0026ldquo;MyProject.vdproj\u0026rdquo; is not supported by MSBuild and cannot be built.\nThis is what the problem is all about. MSBuild, that is used for compiling your projects, does not understand the proprietary vdproj format defined by Microsoft quite some time ago. Unfortunately there is no sign that this will change in the near future, in fact the setup projects has barely changed at all since they were introduced. VS 2010 brings no new features or improvements hen it comes to the setup projects.\nVS 2010 does include a limited version of InstallShield which promises to be more MSBuild friendly and with more or less the same features as VS setup projects. I hope to get a closer look at this installer project type soon.\nBut, how do we go about to build a Visual Studio setup project and produce an MSI as part of a Team Build process? Well, since only one application known to man understands the vdproj projects, we will have to installa copy of Visual Studio on the build server. Sad but true. After doing this, we use the Visual Studio command line interface (devenv) to perform the build.\nIn this post I will show how to do this by using the InvokeProcess activity directly in a build workflow template. You’ll want to run build your setup projects after you have successfully compiled the projects.\nInstall Visual Studio 2010 on the build server(s) \\ Open your build process template /remember to branch or copy the xaml file before modifying it!) \\ Locate the Compile the Project activity \\ Select the activity and open the Variables tab at the lower right \\ Add a new variable called ExitCode of type Int32. This variable will contain the exit code from the devenv process and can be validated for errors. \\ Drop an instance of the InvokeProcess activity from the toolbox onto the designer, after the Run MSBuild for Project activity \\ Drop an instance of the WriteBuildMessage activity inside the Handle Standard Output section. Set the Importance property to Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High (NB: This is necessary if you want the output from devenv to show up in the build log when running the build with the default verbosity) Set the Message property to stdOutput \\ Drop an instance of the WriteBuildError activity to the Handle Error Output section Set the Message property to errOutput \\ Select the InvokeProcess activity and set the values of the parameters to: Note that the Result is piped to the ExitCode variable. \\ The finished workflow should look like this: \\ This will generate the MSI files, but they won’t be copied to the drop location. This is because we are using devenv and not MSBuild, so we have to do this explicitly \\ Drop a Sequence activity somewhere after the Copy to Drop location activity. \\ Create a variable in the Sequence activity of type IEnumerable and call it GeneratedInstallers \\ Drop a FindMatchingFiles activity in the sequence activity and set the properties to: \\ Drop a ForEach activity after the FindMatchingFiles activity. Set the Value property to GeneratedInstallers \\ Drop an InvokeProcess activity inside the ForEach activity. FileName: “xcopy.exe” Arguments: *String.Format(\u0026quot;\u0026quot;\u0026quot;{0}\u0026quot;\u0026quot; \u0026ldquo;\u0026quot;{1}\u0026rdquo;\u0026quot;\u0026quot;, item, BuildDetail.DropLocation) * The Sequence activity should look like this: \\ Save the build process template and check it in. \\ Run the build and verify that the MSI’s is built and copied to the drop location. Note 1: One of the drawback of using devenv like this in a team build is that since all the output from the default compilations is placed in the Binaries folder, the outputs is not avaialable when devenv is invoked, which causes the whole solution to rebuild again. In TFS 2008, this was pretty simple to fix by using the CustomizableOutDir property. In TFS 2010, the same feature is not avaialble. Jim Lamb blogged about this recently, have a look at it if you have a problem with this: http://blogs.msdn.com/jimlamb/archive/2010/04/13/customizableoutdir-in-tfs-2010.aspx\nNote 2: Although the above solution works, a better approach is to wrap this in a custom activity that you can use in your builds. I will come back to this in a future post.\nComments Imported from the original WordPress site. Closed for new replies.\nRob — 06 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#527045\nI\u0026rsquo;m trying to follow these steps but I\u0026rsquo;m stuck on step 7. Alongside where I\u0026rsquo;ve entered [ExitCode] in the Result property there\u0026rsquo;s a Compiler error stating: \u0026ldquo;Compiler error(s) encountered processing expression \u0026ldquo;[ExitCode]\u0026rdquo;. \u0026lsquo;ExitCode\u0026rsquo; is not declared. It may be inaccessible due to its protection level.\u0026rdquo;\nPlease help.\nSteve — 15 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#528299\nI have created a build agent on another server so I can take the load off compiling on the TFS Server itself. I guess I need to install VS 2010 on the Build Server to get my applications to compile correctly. You mentioned installing VS 2010 on the build server, but what edition did you end up installing. I am cheap, I want to install the least expensive edition that I can. Can I install the Shell and get by with that?\neswar — 28 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#530094\nexcellent.\ncan you give an example or a step by step procedure of how to proceed ,for the same scenario?\nAppreciate your help!\nThanks,\neswar\nJeremy — 01 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#531143\nThanks for the article, very well laid out and very helpful!\nI get the same problem as Rob at step #7. If i just leave that field blank, though, instead of putting \u0026ldquo;[ExitCode]\u0026rdquo; in there then everything seems to work fine. I\u0026rsquo;m curious if I even need to do anything about it.\nAlso, on a side note, it seems to expect VB code in all the configuration properties. Is there an option somewhere to make it use C# ?\nThanks,\nJeremy\nChris — 04 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#531563\nThanks for the help, I managed to get this working, except that when the devenv command runs on the build server, the following error is logged. Package \u0026lsquo;Microsoft.VisualStudio.TestTools.TestCaseManagement.QualityToolsPackage, Microsoft.VisualStudio.QualityTools.TestCaseManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\u0026rsquo; failed to load.\nAny ideas, can provide more info if necessary.\nRudi — 18 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#533667\nI was able to solve The package load failure by just using the arguments: \u0026ldquo;/Build \u0026quot; + localProject on the InvokeProcess activity\nRudi — 18 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#533685\naddendum: switching to devenv.exe did the trick.\nJakob Ehn — 14 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#537886\nAll: i have updated the post with the details about the ExitCode variable, sorry for that. Note that in this example I do not actually check the variable afterwards. Do this by adding an If- or Switch activity after the InvokeProcess activity.\nKenn — 21 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#539311\nAbsolutely brilliant, this little article solved several issues that the MS documentation was useless for.\nThanks!\nRob — 28 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#540257\nExcellent post, very helpful. The trouble is I also have the QualityTools.TestCaseManagement issue mentioned above by Chris.\nI think Rudi\u0026rsquo;s solution above is a red herring, it actually results in devenv failing but it doesn\u0026rsquo;t fail the build so it looks like the build has passed (check the log).\nI think the issue is that I\u0026rsquo;m using VS2010 Premium instead of Ultimate and that the QualityTools.TestCaseManagement.DLL is failing to load because the LoadTest.DLL file isn\u0026rsquo;t installed (I\u0026rsquo;m not trying to do Load Testing btw).\nDoes anyone have a solution to this problem?\nI\u0026rsquo;m currently participating in a thread on it, but we don\u0026rsquo;t seem to be getting anywhere, over here: http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/cbfb80ed-0c8f-4f2a-889c-635ccca9db8c/\nRob — 09 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#546646\nThe issue I mentioned above seems to be resolved by using devenv.exe instead of devenv.com\nIf you know of or find a problem with this method then please, please, please post a comment on the MSDN thread mentioned in my above comment.\nMattC — 02 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#550463\nThis is very good and helpful but I still have a problem. I\u0026rsquo;m using devenv to build some non-Microsoft compiler projects (e.g., C, Fortran) that MSBuild can\u0026rsquo;t handle. I see the logged output and in some cases I see errors (e.g., no such source file), but the devenv errors don\u0026rsquo;t seem to come in as error output so the TFS build says no errors (even though the devenv log clearly shows compile and link errors). What are people doing for this?\nRob — 15 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#552638\nMattC, see Jakob\u0026rsquo;s post from 9/21/2010 7:17 PM\nI think you\u0026rsquo;ll need to check the ExitCode variable and then raise errors accordingly. Does that help?\nNachiket — 23 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#554115\nThanks for such a comprehensive post. I am able to get the .msi\u0026rsquo;s but I am unable to get the dll\u0026rsquo;s which are a result of building this project\u0026hellip; I have tried to copy the ExitCode at some location but I found no success\u0026hellip; can you please help me through this.\nSenthilraj — 11 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#557413\nThis is a good work around. But as a permanent solution if you share an article/steps how to leverage the free install shield version comes with VS2010 it will be more help ful..\\\nSonali Noolkar — 15 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#562867\nHi,\nI tried these steps to build the .vdproj. Unfortunately, no msi\u0026rsquo;s are generated/copied to the drop folder.\nI\u0026rsquo;ve checked in the process template after making changes.\nCan you guide..what could be wrong?\nJakob Ehn — 15 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#562869\nSonali: Make sure that you are building the solution configuration that contains the setup project. By default, this is the Release configuration, but it might be different in your setup. Otherwise, run the build in diagnostic mode and check the log for details\nSonali Noolkar — 21 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#563887\nThanks Jakob for the reply.\nThe solution file contains the setup project. The issue was that I had space in the folder name in TFS. enclosed the variable localproject in queotes like \u0026hellip;+ \u0026quot;\u0026rdquo;\u0026quot;\u0026quot; + localProject + \u0026quot;\u0026quot;\u0026quot;\u0026quot; and it worked.\nHowever I am getting below errors:\nC:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEdevenv.com /Build Debug \u0026ldquo;D:Builds5AO SDMC.NETWebApplicationStarterKit4_CISourcesWebApplication.sln\u0026rdquo;\nMicrosoft (R) Visual Studio Version 10.0.30319.1.\nCopyright (C) Microsoft Corp. All rights reserved.\nPackage \u0026lsquo;Microsoft.VisualStudio.TestTools.TestCaseManagement.QualityToolsPackage, Microsoft.VisualStudio.QualityTools.TestCaseManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\u0026rsquo; failed to load.\nPackage \u0026lsquo;Microsoft.VisualStudio.TestTools.TestCaseManagement.QualityToolsPackage, Microsoft.VisualStudio.QualityTools.TestCaseManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\u0026rsquo; failed to load.\nAlso there are 4 other errors with no message associated.\nCan you please guide for these unknown errors?\nSumit — 24 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#564642\nJakob,\nIt looks like I am missing something. Would you please let me know the parameters to be passed as part of MSBuild argument? I am trying to get the msi deployed onto destination server from TFS.\nMaciej Wolniewicz — 04 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#566200\nHi,\nat the begining, thanks for the post, it helped me a lot.\nI got similar problem with \u0026ldquo;Package \u0026lsquo;Microsoft.VisualStudio.TestTools.TestCaseManagement.QualityToolsPackage, Microsoft.VisualStudio.QualityTools.TestCaseManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\u0026rsquo; failed to load.\u0026rdquo;. I resolved it by changing devenv.com to devenv.exe in path to visual studio.\nHope this will help somebody.\nBest regards,\nMaciej\nDave — 18 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#569026\nI came across a fairly simple way to have the output of each project end up in their respective bin/[configuration] so that when compiling the .vdproj, the entire solution is not rebuilt. In step 10 listed above, find \u0026ldquo;Run MSBuild for Project\u0026rdquo;. Select this activity, and in the properties window, clear the property OutDir. This will enable the normal OutputPath of project. However, none of the output files will be copied to the Binaries directory and will then not end up in the drop folder. There will be a warning about in the tfs build log. However, what you will see in the drop folder is the log file and the .msi/.exe, depending on which files were specified to be copied over the drop folder in step 14 when defining the \u0026ldquo;Find generated installers\u0026rdquo; activity.\nNate — 22 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#569660\nI can\u0026rsquo;t figure out where the Copy to Drop activity is\u0026hellip; Maybe I am just blind. Is it possible that the label is something else? Also, could you tell me what high-level parent this is supposed to be in?\nParesh — 24 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#570075\nHi Jakob,\nThanks for the post. It is really helpful. I have a couple of questions though:\n(1) Regarding the ExitCode variable, I\u0026rsquo;m still not quite sure with what condition should I use with a If or switch because I\u0026rsquo;m getting \u0026ldquo;Compiler error(s) encountered processing expression \u0026ldquo;[ExitCode]\u0026rdquo;. \u0026lsquo;ExitCode\u0026rsquo; is not declared. It may be inaccessible due to its protection level.\u0026rdquo; error.\n(2) Also, I\u0026rsquo;m getting the same error for localProject. I would really appreciate if you could help me fix these errors. I\u0026rsquo;m new to MSBuild 4.0.\nThanks a ton,\nParesh\\\nParesh — 26 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#570464\nHi Jakob,\nI\u0026rsquo;m still waiting for your response on the two queries I have above. Please please help me, its real urgent.\nCan anyone else help me out please?\nThanks a ton,\nParesh\nJakob Ehn — 29 Mar 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#570865\n@Paresh: Sorry for the late answer. If you can\u0026rsquo;t reference a workflow variable (such as localProject), the reason is usually that you the variable is not in the current scope. localProject is declared inside the \u0026ldquo;Compile the Project\u0026rdquo; sequence activity,\nwhich means that you can only reference the variable within that activity.\nReagarding the ExitCode variable, have you added the variable to the \u0026ldquo;Compile the Project\u0026rdquo; sequence activity (Step 5 above). If so, you should be able to reference the variable later in the same scope.\\\neric — 21 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#574955\nHi Jakob,\nI\u0026rsquo;m still waiting for your response on the two queries I have above. Please please help me, its real urgent.\nCan anyone else help me out please?\nfolding mountain bike\nRami — 03 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#584248\nHi. I have some problems. I think that I misunderstood some section. Until section 11 you describe how to create msi, but where can I find created files?\nIn section 12 you wrote drop a sequence somewhere after \u0026ldquo;copy to drop\u0026rdquo;, but where should I find \u0026ldquo;copy to drop\u0026rdquo; sequence? Where do you mean by \u0026ldquo;somewhere\u0026rdquo;?\\\nMush — 25 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#587360\nHi,\nI have configured the TFS system in my client Win 7 machine and the MSIs are not getting built and the error is showing as \u0026ldquo;These files could not be found and will not be loaded.\nThe operation could not be completed\u0026rdquo;. I modified the argument for devenv as String.Format(\u0026quot;{0} /build {1}|{2}\u0026quot;, localProject, platformConfiguration.Configuration, platformConfiguration.Platform) as the argument shown in this article was showing error to \u0026ldquo;use devenv [solutionfile | projectfile | anyfile.ext] [switches]\u0026rdquo;\u0026quot;\nWhen I invoke the command from console it builds the MSI But not from the Teambuild system.\nPlease let me know what could be the error.\nEarlier I was always\nMush — 25 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#587373\nHi - When I removed the build configurations, the error is not shown and the project is getting built, but throws error related to DLL reference path. Please elt me know the best way to fix this.\nGratefulCoder — 08 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#589118\nThank you! this is exactly what I was looking for and your steps are very detailed!\nJas — 17 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#590106\nWhole solution is getting copied into the sources folder but i fo not see the compiled files under bin folder\u0026hellip;\nJas — 17 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#590112\nI found the problem. I was trying to build a business intelligence solution. For some reason it does not like to specify the project configuration.I set it as default. But how can i specify the solution and the project to build inside a single build definition?\\\nTJ — 23 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#590813\nXcopy does not work when a build is scheduled in TFS 2010\\\nAmanda — 13 Sep 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#593623\nI\u0026rsquo;m trying to follow these steps but I\u0026rsquo;m stuck on step 16. Returned message is saying: \u0026lsquo;Item\u0026rsquo; is a type and cannot be used as an expression.\nGandalf — 05 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#596027\nThis is just awesome!\nFor those wondering where to find the \u0026ldquo;Copy To Drop\u0026rdquo; activity, this is where I found it\nRun On Agent\u0026ndash;\u0026gt;Try Compile, Test\u0026hellip;(Finally Block)\u0026ndash;\u0026gt;Revert Workspace and Copy Files to Drop Location\nCheers!\nBill — 07 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#596206\nThis is awesome!\nI do have a few questions though. I have implemented this for one of our projects and it was successfully building the MSI files and copying them, however it has stopped working. Any ideas on how to update this to handle any potential errors?\nThe MSI files doesn\u0026rsquo;t seem to be generated by the invoking of DevEnv. However when we build manually on TFS machine running DevEnv the MSI file is found in the release folder for our setup project. Any ideas?\nJakob Ehn — 10 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#596375\n@Bill: Make sure that you are building the correct solution configuration, e.g. Release|Any CPU for example, and that this configuration includes the setup project. Otherwise you need to check the output from devenv, run the build with diagnostic verbosity and examine the output from devenv\njames — 11 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#596556\ngreat post, one of the few on tfs 2010\nLin — 13 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#596773\nHi there,\nfor step 13, i couldn\u0026rsquo;t find type \u0026ldquo;IEnumerable\u0026rdquo; from the dropdown window to create the variable. am i missing some assamplies?\nthanks!\nJ. Meyer — 17 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#597007\nWhich edition of Visual Studio is needed on the build system?\nDoes the Express Edition also work?\nDarren — 01 Nov 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#598510\nFor xcopy failing on scheduled builds, check permissions for the Build Service account on the sourcecode folder (e.g. C:Builds). I use the Network Service account and so gave Full Control to Network Service on C:Builds. The scheduled build was then successful.\nRansch — 11 Nov 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#599634\nLin\nThe IEnumerable is found by; Browse for types. find IEnumerable. Then there will be a combo slection allowing you to change the \u0026rsquo;t\u0026rsquo; to String.\nNow when you select OK it will fill that cell and there will be an additional entry for that cell that will be \u0026ldquo;system.collections.generic.ienumerable\u0026lt;System.String\u0026gt;\nRandy\nPhilip Ammann — 09 Dec 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#602318\nCan you post the xaml file you used for this project?\\\nKen — 19 Mar 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#610523\nIt worked great for me. However,as a side note, I did run into a problem with just building it in a command prompt on the build server. Turns out there is a hot fix for this for Visual studio 2010: https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30681\nVilas Tajane — 10 Jul 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#616249\nLooking assistance for build/automate process in TFS2010. Is there any article shows end -end process which will help to setup the project.\nDL — 12 Jul 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#616444\nWorks great. The only issue I have is that it\u0026rsquo;s creating setups for each referenced project in the solution (that have setups defined) such as webservices. Not a big deal, I\u0026rsquo;m working on modifying the template to build the setup for a specific project within the solution.\nBalu — 09 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#619999\nHey there, thanks for the great article! It worked like charm! Let me suggest two small improvements (hopefully I did not overlooked some in the other comments): \\\nIt would be really great if you could show up the path to the activities mentioned in the article, I have searched some time to find (Compile the Project = Process -\u0026gt; Sequence -\u0026gt; Run on Agent -\u0026gt; Try Compile, Test\u0026hellip; -\u0026gt; Sequence -\u0026gt; Compile, Test, an\u0026hellip; -\u0026gt; Try Compile and Test -\u0026gt; Compile and Test -\u0026gt; For Each Configur\u0026hellip; -\u0026gt; Compile and Test \u0026hellip; -\u0026gt; If BuildSettings.HasProjectsTo -\u0026gt; For Each Proejct in BuildSettin… -\u0026gt; Try to Compile the Project -\u0026gt; Compile the Project)\\ If you set an relative \u0026ldquo;Output file name\u0026rdquo; on the setup project properties you can skip steps 12-17 because the msi file will be automatically build to the right location and is included in the normal Copy to Drop Location. I am not pretty sure with the 2) improvement because I already modified the template slightly concerning source and binary directory but if someone could try it would be a pleasure!\nAnyway great job and thanks for the solution! Hopefully we can get this working also in VS \u0026amp; TFS 2012 where deployment project type is kicked out completely!\nBest Regards\nBalu\n\\ valyas — 21 Jun 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#630331\nThanks for the very helpful article with clear explanations!\nThough, I got a problem :(\nThe VS2010 is installed on the Build Server, but when running the build (all steps as described above OK, modified the devenv.exe path for real one on the build server), I get the error:\n\u0026ldquo;File not found: C:Porgram FilesMicrosoft Visual Studio 10.0Common7IDEdevenv.com\u0026rdquo;\n(The file is there, I\u0026rsquo;ve checked)\nDoes any body know why and how to fix it?\nThanks,\nValyaS\nRama — 04 Aug 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#631190\nThanks a lot! It was beautiful to see this work at my end :-) I thought I was dead in the water.\nKedar — 06 Sep 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#631830\ni followed all the steps. But vdproj is not build with devenv. It is building with MSBuild and gives a warning and showing build is partially succeeded. So can you please help me to resolve the problem\nArturo — 12 Sep 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#631969\nI have problems in the 14 step, when setting the SourceDirectory variable, this appear unavailable.\nAny know why i can\u0026rsquo;t set this variable?\nThanks\naujong — 18 Nov 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#633724\nThank you for the post. It works great.\nBut, is there a way to increase the setup project Version number (and change the Product code ? Without it, if I try to install the installer, I get the error “Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove programs on the control panel.”\nJakob Ehn — 18 Nov 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#633725\n@Aujong: You have to add another activity to do that. There is no out of the box though for do that so you have to write your own that increases the version number in the vdproj and also changes the product code.\nChinnu — 29 Nov 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#633976\nHi,\nI have the setup project containing the solution build in VS 2010.\nI have setup the Workflow template as per the steps mentioned above and only issue im facing while building the project is File not found for devenv.exe. VS 2010 is not installed in the Build server but VS 2012 is installed. Can i give the devenv path of 2012? I tried giving that path also but giving the same exception as File Not Foud. Please help\nJakob Ehn — 29 Nov 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#633988\n@Chinnu: Yes, just change the path to 11.0 instead of 10.0 and it should work just fine\n/Jakob\nChinnu — 04 Dec 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#634057\nHi Jakob,\nThanks for the input. Build is working fine.\nBut it seems like MSI is not found in the dropped location. do we need to build the.vdproj [msi project] in Process tab in the build definition. or Only building the solution will work. since solution contains two projects one which creates exe and another msi. i have modified the solution configuration for this solution by checking that Build option for vdproj project. but ended in a warning saying that .vdproj is not supported by MSBuild and cannot be built.\nPrashant — 07 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#635517\nHi All, I have a question\u0026hellip;. Do the server hosting the TFS Server 2012 also needs to have VS2005 installed for providing \u0026ldquo;devenv.exe\u0026rdquo; path for invoke method? Also, can you please let me know how to get the reports that are part of the project be included in the build\nPrashant — 11 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#635578\nHi,\nCan you please let me know how can i build projects created in VS2005?\nAlso, if possible please let me know exactly where can i find the step 3 details, as i am not able to find it in the default.xaml file that is been used\nzuzu — 20 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#635722\nThank you for the detailed steps above. However, I am getting a compile error saying: Compile error(s) encountered processing expression \u0026ldquo;GeneratedInstallers\u0026rdquo;. \u0026lsquo;String\u0026rsquo; cannot be converted to \u0026lsquo;System.Collections.Generic.IEnumerable(Of String)\u0026rsquo; because \u0026lsquo;Char\u0026rsquo; is not derived from \u0026lsquo;String\u0026rsquo;, as required for the \u0026lsquo;Out\u0026rsquo; generic parameter \u0026lsquo;T\u0026rsquo; in \u0026lsquo;Interface IEnumerable(Of Out T)\u0026rsquo;. Please let me know how this can be fixed.\nJakob Ehn — 20 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#635723\n@zuzu: You probably have used the wrong variable type for the GeneratedInstallers variable. Make sure that you use IEnumerable for this variable, since that is what the FindMatchingFiles activity returns\n/Jakob\nzuzu — 20 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#635727\nThank very much for your quick response. How do i select this option? When I create variable \u0026ldquo;GeneratedInstallers\u0026rdquo;, the IEnumerable is not an option in the drop down window. I have String, Int32, etc\u0026hellip;\nJakob Ehn — 21 Feb 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#635735\n@zuzu: You need to select the browse button that allows you to select any type that is currenty referenced. Browse to the IEnumerable type and the select string as the parameterized type\n/Jakob\nB.Y. Pang — 02 May 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx#637475\nWith 2013 supporting setup project, can the same procedure work for 2013 TFS? Thank you very much.\\\n","permalink":"https://blog.ehn.nu/2010/05/building-visual-studio-setup-projects-with-tfs-2010-team-build/","summary":"\u003cp\u003eUPDATE: 2010-09-15 – Added details about the use of the ExitCode variable\u003c/p\u003e\n\u003cp\u003eOne of the most common complaints from people starting to use Team Build is that is doesn’t support building Microsoft’s own Setup and Deployment project (*.vdproj). When creating a default build definition that compiles a solution containing a setup project, you’ll get the following warning:\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eThe project file \u0026ldquo;MyProject.vdproj\u0026rdquo; is not supported by MSBuild and cannot be built.\u003c/em\u003e\u003c/p\u003e","title":"Building Visual Studio Setup Projects with TFS 2010 Team Build"},{"content":"I still see people complaining about the long time it takes to load test results from a TFS build in Visual Studio. And they make a valid point, it does take a very long time to load the test results, even for a small number of tests. The reason for this is that the test results is not just the result of the test run but also all the binaries that were part of the test run. This often also means that the debug symbols (*.pdb) will be downloaded to your local machine. This reason for this behaviour is that it letsyou re-run the tests locally.\nHowever, most of the times this is not what the developer will do, they just want to know which tests failed and why. They can then fix the tests and rerun them locally. It turns out there is a way to load only the test results, which is much faster. The only tricky bit is to find the location of the .trx file that is generated during the build. Particularly in TFS 2010 where you often have multiple build agents, which of corse results in different paths to the trx file. Note: To use this you must have read permission to the build folder on the build agent where the build was executed.\nOpen the build result for the build \\ Click View Log \\ Locate the part where MSTest is invoked. When using test containers, it looks like this: Note: You can actually search in the log window, press Ctrl+F and you will get a little search box at the bottom. Nice! \\ On the MSTest command line call, locate the /resultsfileroot parameter, which points to the folder where the test results are stored \\ Note that this path is local for the build server, so you need to replace the drive letter with the server name: *D:BuildsProjectTestResults to ProjectTestResults\u0026quot;\u0026gt;\u0026lt;BuildServer\u0026gt;ProjectTestResults * Double-click on the .trx file and you will notice that it loads much faster compared to opening it from the build log window Comments Imported from the original WordPress site. Closed for new replies.\nRoss Johnston — 25 May 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/09/speed-up-loading-of-test-results-from-builds-in-visual.aspx#521170\nHi Jakob, thanks for the tip. But just to make sure I understand how it works, this will only work for the latest build right? You can\u0026rsquo;t use this workaround to load test results for previous builds right?\nBecause the TestResults folder on the build machine will be deleted and recreated for each build run.\nThanks,\nRoss\nJakob Ehn — 28 May 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/09/speed-up-loading-of-test-results-from-builds-in-visual.aspx#521603\nRoss: That is correct, it only works for the latest test run.\n","permalink":"https://blog.ehn.nu/2010/05/speed-up-loading-of-test-results-from-builds-in-visual-studio/","summary":"\u003cp\u003eI still see people complaining about the long time it takes to load test results from a TFS build in Visual Studio. And they make a valid point, it \u003cstrong\u003edoes\u003c/strong\u003e take a very long time to load the test results, even for a small number of tests. The reason for this is that the test results is not just the result of the test run but also all the binaries that were part of the test run. This often also means that the debug symbols (*.pdb) will be downloaded to your local machine. This reason for this behaviour is that it letsyou re-run the tests locally.\u003c/p\u003e","title":"Speed up loading of test results from builds in Visual Studio"},{"content":"When upgrading from TFS 2008 to TFS 2010, all builds are “upgraded” in the sense that a build definition with the same name is created, and it uses the UpgradeTemplate build process template to execute the build. This template basically just runs MSBuild on the existing TFSBuild.proj file. The build definition contains a property called ConfigurationFolderPath that points to the TFSBuild.proj file.\nSo, existing builds will run just fine after upgrade. But what if you want to use the new workflow functionality in TFS 2010 Build, but still have a lot of MSBuild scripts that maybe call custom MSBuild tasks that you don’t have the time to rewrite? Then one option is to keep these MSBuild scrips and call them from a TFS 2010 Build workflow. This can be done using the MSBuild workflow activity that is avaiable in the toolbox in the Team Foundation Build Activities section:\nThis activity wraps the call to MSBuild.exe and has the following parameters:\nMost of these properties are only relevant when actually compiling projects, for example C# project files. When calling custom MSBuild project files, you should focus on these properties:\nProperty Meaning Example CommandLineArguments Use this to send in/override MSBuild properties in your project “/p:MyProperty=SomeValue” or MSBuildArguments (this will let you define the arguments in the build definition or when queuing the build) LogFile Name of the log file where MSbuild will log the output “MyBuild.log” LogFileDropLocation Location of the log file BuildDetail.DropLocation + “log” Project The project to execute SourcesDirectory + “BuildExtensions.targets” ResponseFile The name of the MSBuild response file SourcesDirectory + “BuildExtensions.rsp” Targets The target(s) to execute New String() {“Target1”, “Target2”} Verbosity Logging verbosity Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal Integrating with Team Build\nIf your MSBuild scripts tries to use Team Build tasks, they will most likely fail with the above approach. For example, the following MSBuild project file tries to add a build step using the BuildStep task:\n\u0026lt;?xml version=\u0026#34;1.0\u0026#34; encoding=\u0026#34;utf-8\u0026#34;?\u0026gt; \u0026lt;Project ToolsVersion=\u0026#34;4.0\u0026#34; xmlns=\u0026#34;http://schemas.microsoft.com/developer/msbuild/2003\u0026#34;\u0026gt; \u0026lt;Import Project=\u0026#34;$(MSBuildExtensionsPath)MicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets\u0026#34; /\u0026gt; \u0026lt;Target Name=\u0026#34;MyTarget\u0026#34;\u0026gt; \u0026lt;BuildStep TeamFoundationServerUrl=\u0026#34;$(TeamFoundationServerUrl)\u0026#34; BuildUri=\u0026#34;$(BuildUri)\u0026#34; Name=\u0026#34;MyBuildStep\u0026#34; Message=\u0026#34;My build step executed\u0026#34; Status=\u0026#34;Succeeded\u0026#34;\u0026gt;\u0026lt;/BuildStep\u0026gt; \u0026lt;/Target\u0026gt; \u0026lt;/Project\u0026gt; When executing this file using the MSBuild activity, calling the MyTarget, it will fail with the following message:\nThe \u0026ldquo;Microsoft.TeamFoundation.Build.Tasks.BuildStep\u0026rdquo; task could not be loaded from the assembly PrivateAssembliesMicrosoft.TeamFoundation.Build.ProcessComponents.dll. Could not load file or assembly \u0026lsquo;file:///D:PrivateAssembliesMicrosoft.TeamFoundation.Build.ProcessComponents.dll\u0026rsquo; or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.\nYou can see that the path to the ProcessComponents.dll is incomplete. This is because in the Microsoft.TeamFoundation.Build.targets file the task is referenced using the $(TeamBuildRegPath) property. Also note that the task needs the TeamFounationServerUrl and BuildUri properties. One solution here is to pass these properties in using the Command Line Arguments parameter:\nHere we pass in the parameters with the corresponding values from the curent build. The build log shows that the build step has in fact been inserted:\nThe problem as you probably spted is that the build step is insert at the top of the build log, instead of next to the MSBuild activity call. This is because we are using a legacy team build task (BuildStep), and that is how these are handled in TFS 2010. You can see the same behaviour when running builds that are using the UpgradeTemplate, that cutom build steps shows up at the top of the build log.\nComments Imported from the original WordPress site. Closed for new replies.\ngsogol — 23 Jun 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/05/executing-legacy-msbuild-scripts-in-tfs-2010-build.aspx#525316\nWhat happens when one builds customs tasks off of TFS 2005 build dlls. Do you have to copy all of those dlls to the TFS 2010 server?\nRyan — 07 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/05/executing-legacy-msbuild-scripts-in-tfs-2010-build.aspx#527288\nFor some reason, when using this method, I always get the message that \u0026ldquo;the project file \u0026hellip; was not found\u0026rdquo;, where \u0026ldquo;\u0026hellip;\u0026rdquo; is the exact correct path to the project file that I created. I checked on the server, and the file is definitely there! What\u0026rsquo;s going on?\nRIyer — 06 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/05/executing-legacy-msbuild-scripts-in-tfs-2010-build.aspx#556257\nThanks a bunch, Jakob!\nBharath — 29 Nov 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/05/executing-legacy-msbuild-scripts-in-tfs-2010-build.aspx#601318\nWill this solution work in case, Powershell scripts have been called from MSBuild script?\nahmad — 14 Jun 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/05/05/executing-legacy-msbuild-scripts-in-tfs-2010-build.aspx#644765\nvery useful, thanks\n","permalink":"https://blog.ehn.nu/2010/05/executing-legacy-msbuild-scripts-in-tfs-2010-build/","summary":"\u003cp\u003eWhen upgrading from TFS 2008 to TFS 2010, all builds are “upgraded” in the sense that a build definition with the same name is created, and it uses the \u003cem\u003eUpgradeTemplate\u003c/em\u003e  build process template to execute the build. This template basically just runs MSBuild on the existing TFSBuild.proj file. The build definition contains a property called \u003cem\u003eConfigurationFolderPath\u003c/em\u003e that points to the TFSBuild.proj file.\u003c/p\u003e\n\u003cp\u003eSo, existing builds will run just fine after upgrade. But what if you want to use the new workflow functionality in TFS 2010 Build, but still have a lot of MSBuild scripts that maybe call custom MSBuild tasks that you don’t have the time to rewrite? Then one option is to keep these MSBuild scrips and call them from a TFS 2010 Build workflow. This can be done using the MSBuild workflow activity that is avaiable in the toolbox in the \u003cem\u003eTeam Foundation Build Activities\u003c/em\u003e section:\u003c/p\u003e","title":"Executing legacy MSBuild scripts in TFS 2010 Build"},{"content":"The default behaviour in TFS Team Build (all versions) is to create a bug work item when a build fails. This main benefit of this is that you get a work item for something that needs to be done, namely to fix the build!. When the developer responsible for the build failure has fixed the problem, he/she can associated that check-in with the work item that was created from the previous build failure.\nIn TFS 2005/2008 you could modify the information in the created work item by changing some predefined properties in the TFSBuild.proj file:\n\u0026lt;!-- WorkItemType The type of the work item created on a build failure. --\u0026gt; \u0026lt;WorkItemType\u0026gt;Bug\u0026lt;/WorkItemType\u0026gt; \u0026lt;!-- WorkItemFieldValues Fields and values of the work item created on a build failure. Note: Use reference names for fields if you want the build to be resistant to field name changes. Reference names are language independent while friendly names are changed depending on the installed language. For example, \u0026#34;System.Reason\u0026#34; is the reference name for the \u0026#34;Reason\u0026#34; field. --\u0026gt; \u0026lt;WorkItemFieldValues\u0026gt;System.Reason=Build Failure;System.Description=Start the build using Team Build\u0026lt;/WorkItemFieldValues\u0026gt; \u0026lt;!-- WorkItemTitle Title of the work item created on build failure. --\u0026gt; \u0026lt;WorkItemTitle\u0026gt;Build failure in build:\u0026lt;/WorkItemTitle\u0026gt; \u0026lt;!-- DescriptionText History comment of the work item created on a build failure. --\u0026gt; \u0026lt;DescriptionText\u0026gt;This work item was created by Team Build on a build failure.\u0026lt;/DescriptionText\u0026gt; \u0026lt;!-- BuildLogText Additional comment text for the work item created on a build failure. --\u0026gt; \u0026lt;BuildlogText\u0026gt;The build log file is at:\u0026lt;/BuildlogText\u0026gt; \u0026lt;!-- ErrorWarningLogText Additional comment text for the work item created on a build failure. This text will only be added if there were errors or warnings. --\u0026gt; \u0026lt;ErrorWarningLogText\u0026gt;The errors/warnings log file is at:\u0026lt;/ErrorWarningLogText\u0026gt; In TFS 2010, with Windows Workflow, you change this by modifying the properties on the OpenWorkItem activity. The hardest part of this is to actually find where this activity is located in the build process workflow. If you open the build definition in XAML you can just search for OpenWorkItem. If you use the designer you need to click your way down to the Catch section of the Try to Compile the Project sequence:\nTo change the default values of the created work item, select the Created Work Item activity and look at the Properties window:\nNote the CustomFields property which is a dictionary with key (work item field name) and value. If you add custom fields to your work item you can add a value for it here by adding a new entry in the dictionary.\nComments Imported from the original WordPress site. Closed for new replies.\nbetty — 03 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/28/modify-build-failure-work-item-in-tfs-2010-build.aspx#571948\nCan you either make it reuse the same bug over and over or automatically close bugs once the build passes?\nSlartibartfast81 — 12 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/28/modify-build-failure-work-item-in-tfs-2010-build.aspx#585346\nI have a couple of questions:\nAre you using the DefaultTemplate.xaml build template here?\nShould the the activity shown be added to the template? I can\u0026rsquo;t find it at the indicated position, which I have found, and I wonder if the template shown is actually part of the MS Agile proces template 5.0 definition.\n","permalink":"https://blog.ehn.nu/2010/04/modify-build-failure-work-item-in-tfs-2010-build/","summary":"\u003cp\u003eThe default behaviour in TFS Team Build (all versions) is to create a bug work item when a build fails. This main benefit of this is that you get a work item for something that needs to be done, namely to fix the build!. When the developer responsible for the build failure has fixed the problem, he/she can associated that check-in with the work item that was created from the previous build failure.\u003c/p\u003e","title":"Modify Build Failure Work Item in TFS 2010 Build"},{"content":"*** 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: http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/CreateTFSBuildDefinition.zip\nIn 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 out in the New Build Definition Wizard:\nSo, 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:\nTfsTeamProjectCollection server = newTfsTeamProjectCollection(newUri(\u0026ldquo;http://:/tfs\u0026rdquo;)); server.EnsureAuthenticated(); IBuildServer buildServer = (IBuildServer) server.GetService(typeof (IBuildServer));\nGeneral First we create a IBuildDefinition object for the team project and set a name and description for it: var buildDefinition = buildServer.CreateBuildDefinition(teamProject); buildDefinition.Name = \u0026#34;TestBuild\u0026#34;; buildDefinition.Description = \u0026#34;description here...\u0026#34;; **Trigger **Next up, we set the trigger type. For this one, we set it to individual which corresponds to the Continuous Integration - Build each check-in trigger option buildDefinition.ContinuousIntegrationType = ContinuousIntegrationType.Individual;\n**Workspace **For the workspace mappings, we create two mappings here, where one is a cloak. Note the user of $(SourceDir) variable, which is expanded by Team Build into the sources directory when running the build. buildDefinition.Workspace.AddMapping(\u0026quot;$/Path/project.sln\u0026quot;, \u0026ldquo;$(SourceDir)\u0026rdquo;, WorkspaceMappingType.Map); buildDefinition.Workspace.AddMapping(\u0026quot;$/OtherPath/\u0026quot;, \u0026ldquo;\u0026rdquo;, WorkspaceMappingType.Cloak);\nBuild Defaults In the build defaults, we set the build controller and the drop location. To get a build controller, we can (for example) use the GetBuildController method to get an existing build controller by name: buildDefinition.BuildController = buildServer.GetBuildController(buildController); buildDefinition.DefaultDropLocation = @\\SERVERDropTestBuild; **Process **So far, this wasy easy. Now we get to the tricky part. TFS 2010 Build is based on Windows Workflow 4.0. The build process is defined in a separate .XAML file called a Build Process Template. By default, every new team team project containtwo build process templates called DefaultTemplate and UpgradeTemplate. In this sample, we want to create a build definition using the default template. We use te QueryProcessTemplates method to get a reference to the default for the current team project\n//Get default template var defaultTemplate = buildServer.QueryProcessTemplates(teamProject).Where(p =\u0026gt; p.TemplateType == ProcessTemplateType.Default).First(); buildDefinition.Process = defaultTemplate;\nThere are several build process templates that can be set for the default build process template. Only one of these are required, the ProjectsToBuild parameters which contains the solution(s) and configuration(s) that should be built. To set this info, we use the ProcessParameters property of thhe IBuildDefinition interface. The format of this property is actually just a serialized dictionary (IDictionary\u0026lt;string, object\u0026gt;) that maps a key (parameter name) to a value which can be any kind of object. This is rather messy, but fortunately, there is a helper class called WorkflowHelpers inthe Microsoft.TeamFoundation.Build.Workflow namespace, that simplifies working with this persistence format a bit. The following code shows how to set the BuildSettings information for a build definition:\n//Set process parameters varprocess = WorkflowHelpers.DeserializeProcessParameters(buildDefinition.ProcessParameters); //Set BuildSettings properties BuildSettings settings = newBuildSettings(); settings.ProjectsToBuild = newStringList(\u0026#34;$/pathToProject/project.sln\u0026#34;); settings.PlatformConfigurations = newPlatformConfigurationList(); settings.PlatformConfigurations.Add(newPlatformConfiguration(\u0026#34;Any CPU\u0026#34;, \u0026#34;Debug\u0026#34;)); process.Add(\u0026#34;BuildSettings\u0026#34;, settings); buildDefinition.ProcessParameters = WorkflowHelpers.SerializeProcessParameters(process); The other build process parameters of a build definition can be set using the same approach\n**Retention Policy **This one is easy, we just clear the default settings and set our own:\nbuildDefinition.RetentionPolicyList.Clear(); buildDefinition.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Succeeded, 10, DeleteOptions.All); buildDefinition.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Failed, 10, DeleteOptions.All); buildDefinition.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.Stopped, 1, DeleteOptions.All); buildDefinition.AddRetentionPolicy(BuildReason.Triggered, BuildStatus.PartiallySucceeded, 10, DeleteOptions.All);\n**Save It! **And we’re done, lets save the build definition:\nbuildDefinition.Save();\nThat’s it!\nComments Imported from the original WordPress site. Closed for new replies.\nBob Hardister — 16 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#533317\nHi Jokob, can you post an example of a working solution/project that can be downloaded?\nY.B — 16 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#538205\n//Set BuildSettings properties var settings = GenerateBuildSettings();\nprocess.Add(\u0026ldquo;BuildSettings\u0026rdquo;, settings);\nprocess.Add(\u0026ldquo;TestSpecs\u0026rdquo;, new TestSpecList());\nprocess.Add(\u0026ldquo;RunCodeAnalysis\u0026rdquo;, CodeAnalysisOption.Never);\nprocess.Add(\u0026ldquo;SourceAndSymbolServerSettings\u0026rdquo;, new SourceAndSymbolServerSettings());\nprocess.Add(\u0026ldquo;CreateWorkItem\u0026rdquo;, false);\nprocess.Add(\u0026ldquo;PerformTestImpactAnalysis\u0026rdquo;, false);\nprocess.Add(\u0026ldquo;DisableTests\u0026rdquo;, true);\nprocess.Add(\u0026ldquo;Verbosity\u0026rdquo;, BuildVerbosity.Minimal);\nShmil — 11 Oct 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#542320\nHow can I run private Build (based on Shelveset) through the API?\\\nWouter van Vugt — 08 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#572863\nThe WorkflowHelpers class is inside a private assembly to Visual Studio. You are not allowed to use it. Fallback is to use the XamlServices.Save method in the System.Xaml assembly.\nWillow Wagner — 17 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#578226\nHow can I pass paramters through the build definition? Would adding a couple fields to dynamically created build definition be the best way to make that happen?\nCristian Casanova — 12 Nov 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#621435\nIs there another link to download the complete sample application? The mentioned one above is broken.\nThanks\nJohn Bruno — 04 Apr 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#626691\nHi, thanks so much for post this. Everything is working great except 1 thing. This code only works the first time I run it. Subsequent attempts result in the followwing error: Sequence contains no elements.\nSo it finds the template the first time, but that\u0026rsquo;s it. var defaultTemplate = buildServer.QueryProcessTemplates(teamProject).Where(p =\u0026gt; p.TemplateType == ProcessTemplateType.Default).First(); Thanks, John\\\nTobi — 11 Aug 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#639428\nHi,\nthanks for your post, its very helpfull. But I still got a question.\nI want to add a RetentionPolicy, but i want to add multiple DeleteOptions, but i don\u0026rsquo;t see a way to do this.\nFor example the delete options should be set to DropLocation, Label AND Symbols.\nThanks for your help.\nTobi\nTom Harrison — 17 Aug 2015\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx#645831\nHi there. Great post.\nYour link to the build sample app is broken. Can you please transfer this example to github?\nThanks!\n","permalink":"https://blog.ehn.nu/2010/04/creating-a-build-definition-using-the-tfs-2010-api/","summary":"\u003cp\u003e*** 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: \u003cbr\u003e\n\u003ca href=\"http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/CreateTFSBuildDefinition.zip\" title=\"http://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/CreateTFSBuildDefinition.zip\"\u003ehttp://cid-ee034c9f620cd58d.office.live.com/self.aspx/BlogSamples/CreateTFSBuildDefinition.zip\u003c/a\u003e\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003eIn 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 \u003cbr\u003e\nout in the New Build Definition Wizard:\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://gwb.blob.core.windows.net/jakob/WindowsLiveWriter/CreatingaBuildDefinitionusingtheTFS2010A_12F55/image_4.png\"\u003e\u003cimg alt=\"image\" loading=\"lazy\" src=\"/2010/04/creating-a-build-definition-using-the-tfs-2010-api/28_image_thumb_1.png\" title=\"image\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eSo, 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:\u003c/p\u003e","title":"Creating a Build Definition using the TFS 2010 API"},{"content":"When embracing Team Build 2010, you typically want to define several different build process templates for different scenarios. Common examples here are CI builds, QA builds and release builds. For example, in a contiuous build you often have no interest in publishing to the symbol store, you might or might not want to associate changesets and work items etc. The build server is often heavily occupied as it is, so you don’t want to have it doing more that necessary. Try to define a set of build process templates that are used across your company. In previous versions of TFS Team Build, there was no easy way to do this. But in TFS 2010 it is very easy so there is no excuse to not do it! :-)\nI ran into a scenario today where I had an existing build definition that was based on our release build process template. In this template, we have defined several different build process parameters that control the release build. These are placed into its own sectionin the Build Process Parameters editor. This is done using the ProcessParameterMetadataCollection element, I will explain how this works in a future post.\nI won’t go into details on these parametes, the issue for this blog post is what happens when you modify a build process template so that it is no longer compatible with the build definition, i.e. a breaking change. In this case, I removed a parameter that was no longer necessary. After merging the new build process template to one of the projects and queued a new release build, I got this error:\nTF215097: An error occurred while initializing a build for build definition : *The values provided for the root activity\u0026rsquo;s arguments did not satisfy the root activity\u0026rsquo;s requirements: \u0026lsquo;DynamicActi*vity\u0026rsquo;: The following keys from the input dictionary do not map to arguments and must be removed: . Please note that argument names are case sensitive. Parameter name: rootArgumentValues\nwas the parameter that I removed so it was pretty easy to understand why the error had occurred. However, it is not entirely obvious how to fix the problem. When open the build definition everything looks OK, the removed build process parameter is not there, and I can open the build process template without any validation warnings.\nThe problem here is that all settings specific to a particular build definition is stored in the TFS database. In TFS 2005, everything that was related to a build was stored in TFS source control in files (TFSBuild.proj, WorkspaceMapping.xml..). In TFS 2008, many of these settings were moved into the database. Still, lots of things were stored in TFSBuild.proj, such as the solution and configuration to build, wether to execute tests or not. In TFS 2010, all settings for a build definition is stored in the database. If we look inside the database we can see what this looks like. The table tbl_BuildDefinition contains all information for a build definition. One of the columns is called ProcessParameters and contains a serialized representation of a Dictionary that is the underlying object where these settings are stoded. Here is an example:\n\u0026lt;Dictionary x:TypeArguments=\u0026#34;x:String, x:Object\u0026#34; xmlns=\u0026#34;clr-namespace:System.Collections.Generic;assembly=mscorlib\u0026#34; xmlns:mtbwa=\u0026#34;clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow\u0026#34; xmlns:x=\u0026#34;http://schemas.microsoft.com/winfx/2006/xaml\u0026#34;\u0026gt; \u0026lt;mtbwa:BuildSettings x:Key=\u0026#34;BuildSettings\u0026#34; ProjectsToBuild=\u0026#34;$/PathToProject.sln\u0026#34;\u0026gt; \u0026lt;mtbwa:BuildSettings.PlatformConfigurations\u0026gt; \u0026lt;mtbwa:PlatformConfigurationList Capacity=\u0026#34;4\u0026#34;\u0026gt; \u0026lt;mtbwa:PlatformConfiguration Configuration=\u0026#34;Release\u0026#34; Platform=\u0026#34;Any CPU\u0026#34; /\u0026gt; \u0026lt;/mtbwa:PlatformConfigurationList\u0026gt; \u0026lt;/mtbwa:BuildSettings.PlatformConfigurations\u0026gt; \u0026lt;/mtbwa:BuildSettings\u0026gt; \u0026lt;mtbwa:AgentSettings x:Key=\u0026#34;AgentSettings\u0026#34; Tags=\u0026#34;Agent1\u0026#34; /\u0026gt; \u0026lt;x:Boolean x:Key=\u0026#34;DisableTests\u0026#34;\u0026gt;True\u0026lt;/x:Boolean\u0026gt; \u0026lt;x:String x:Key=\u0026#34;ReleaseRepositorySolution\u0026#34;\u0026gt;ERP\u0026lt;/x:String\u0026gt; \u0026lt;x:Int32 x:Key=\u0026#34;Major\u0026#34;\u0026gt;2\u0026lt;/x:Int32\u0026gt; \u0026lt;x:Int32 x:Key=\u0026#34;Minor\u0026#34;\u0026gt;3\u0026lt;/x:Int32\u0026gt; \u0026lt;/Dictionary\u0026gt; Here we can see that it is really only the non-default values that are persisted into the databasen. So, the problem in my case was that I removed one of the parameteres from the build process template, but the parameter and its value still existed in the build definition database. The solution to the problem is to refresh the build definition and save it. In the process tab, there is a Refresh button that will reload the build definition and the process template and synchronize them:\nAfter refreshing the build definition and saving it, the build was running successfully again.\nComments Imported from the original WordPress site. Closed for new replies.\nSean Stolberg — 25 Jun 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#525573\nThanks, Jakob. Just ran into this error too where I removed the BuildSettings default parameter for an auto-deploy build I setup (nothing to build on this one, it\u0026rsquo;s tests deployment of our installer). I did the refresh, but hadn\u0026rsquo;t done the save (not totally intuitive).\nAnyhow, saving did the trick and the build is running normally now.\nThanks,\nSean\nafsharm — 16 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#528779\nMany thanks Jakob. You save me plenty of time.\nGus — 08 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#561723\nCheers mate, saved me some time there!\nGokul — 28 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#575741\nThanks a lot! Saved my time!!\nShurik Shin — 04 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#588644\nThanks to you.\nIt was very useful for me.\ndz — 28 Feb 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#608943\nThanks a lot\nRobert — 05 Mar 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#609541\nThanks, I\u0026rsquo;ve been banging my head against this for a few days\u0026hellip; I had the exact same scenario.\nKent — 15 Mar 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#610297\nThanks for this information. You just kept me from aging about 10 years. I have been struggling to make changes to the xaml file and had it working with a test project. However, when I applied it to the real project, I began to see this error and thought I had really screwed up. Thanks again for sharing.\nDele O — 11 Sep 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#618936\nAny advice on how to do this for 40 different builds that seem to have the same error? is it possible via TFS API?\nBrian — 06 Oct 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#619894\nHad this same error using TFS2012. Found that refreshsave didn\u0026rsquo;t work. Had to change the template, save and then change it back and save again\u0026hellip; YMMV.\ndeadlydog — 10 Jan 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#623641\nThis issue also has a MSDN Forums question about it with additional steps if the ones here alone don\u0026rsquo;t do the trick. http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/bc94f25d-e22d-4342-bfdb-28408d9e2a29/\ndr memals — 10 May 2013\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx#628606\nrefersh and save did not work for me. Had to go back to the build template and readd the argument, then delete the value from the build definition, then go back and remove it again.\nBut your post pointed me in the right direction, so thanks.\n","permalink":"https://blog.ehn.nu/2010/04/getting-tf215097-error-after-modifying-a-build-process-template-in-tfs-team-build-2010/","summary":"\u003cp\u003eWhen embracing Team Build 2010, you typically want to define several different build process templates for different scenarios. Common examples here are CI builds, QA builds and release builds. For example, in a contiuous build you often have no interest in publishing to the symbol store, you might or might not want to associate changesets and work items etc. The build server is often heavily occupied as it is, so you don’t want to have it doing more that necessary. Try to define a set of build process templates that are used across your company. In previous versions of TFS Team Build, there was no easy way to do this. But in TFS 2010 it is very easy so there is no excuse to not do it! :-)\u003c/p\u003e","title":"Getting TF215097 error after modifying a build process template in TFS Team Build 2010"},{"content":"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.\nAll well, but there uis a dimension missing here, regarding to releases. Often you can run several release builds until you actually deploy the result of the build to a test or production system. When you do this, wouldn’t it be nice to be able to send the customer a nice release note that contain all work items and changeset since the previously deployed version?\nAt our company, we have developed a Release Repository, which basically is a siple web site with a SQL database as storage. Every time we run a Release Build, the resulting installers, zip-files, sql scripts etc, gets pushed into the release repositor together with the relevant build information. This information contains things such as start time, who triggered the build etc. Also, it contains the associated changesets and work items.\nWhen deploying the MSI’s for a new version, we mark the build as Deployedin the release repository. The depoyed status is stored in the release repository database, but it could also have been implemented by setting the Build Quality for that build to Deployed.\nWhen generating the release notes, the web site simple runs through each release build back to the previous build that was marked as Deplyed, and aggregates the work items and changesets:\nHere is a sample screenshot on how this looks for a sample build/application\nThe web site is available both for us and also for the customers and testers, which means that they can easily get the latest version of a particular application and at the same time see what changes are included in this version. There is a lot going on in the Release Build Process that drives this in our TFS 2010 server, but in this post I will show how you can access and read the changeset and work item information in a custom activity. \\\nSince Team Build associates changesets and work items for each build, this information is (partially) available inside the build process template. The Associate Changesets and Work Items for non-Shelveset Builds activity (located inside the Try Compile, Test, and Associate Changesets and Work Items activity) defines and populates a variable called associatedWorkItems\nYou can see that this variable is an IList containing instances of the Changeset class (from the Microsoft.TeamFoundation.VersionControl.Client namespace). Now, if you want to access this variable later on in the build process template, you need to declare a new variable in the corresponding scope and the assign the value to this variable. In this sample, I declared a variable called assocChangesets in the RunAgent sequence, which basically covers the whol compile, test and drop part of the build process:\nNow, you need to assign the value from the AssociatedChangesets to this variable. This is done using the Assign workflow activity:\nNow you can add a custom activity any where inside the RunAgent sequence and use this variable. NB: Of course your activity must place somewhere after the variable has been poplated. To finish off, here is code snippet that shows how you can read the changeset and work item information from the variable.\nFirst you add an InArgumet on your activity where you can pass i the variable that we defined.\n[RequiredArgument] public InArgument\u0026lt;IList\u0026lt;Changeset\u0026gt;\u0026gt; AssociatedChangesets { get; set; } Then you can traverse all the changesets in the list, and for each changeset use the WorkItems property to get the work items that were associated in that changeset:\nforeach (Changeset ch in associatedChangesets) { // Add change theChangesets.Add( new AssociatedChangeset(ch.ChangesetId, ch.ArtifactUri, ch.Committer, ch.Comment, ch.ChangesetId)); foreach (var wi in ch.WorkItems) { theWorkItems.Add( new AssociatedWorkItem(wi[\u0026#34;System.AssignedTo\u0026#34;].ToString(), wi.Id, wi[\u0026#34;System.State\u0026#34;].ToString(), wi.Title, wi.Type.Name, wi.Id, wi.Uri)); } } NB: AssociatedChangeset and AssociatedWorkItem are custom classes that we use internally for storing this information that is eventually pushed to the release repository.\nComments Imported from the original WordPress site. Closed for new replies.\nSaravanan — 21 Apr 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/15/implementing-release-notes-in-tfs-team-build-2010.aspx#516197\nCan i display these changesets with all workitems as a formatted output ?\nFounder — 17 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/15/implementing-release-notes-in-tfs-team-build-2010.aspx#547992\nCan u get also the complete workitem list for a certain iteration. To show all the open requirements or backlog items?\nMike Paterson — 14 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/15/implementing-release-notes-in-tfs-team-build-2010.aspx#552290\nCan we get the source code for this?\nMush — 08 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/15/implementing-release-notes-in-tfs-team-build-2010.aspx#584885\nHi,\nCan we invoke this from tfs command line. currently we are not using the teambuild and use the cruisecontrol for continuous integration. we would like to generate a report between two releases which will list the changesets and teh workitems. Using the TF History, I could get the changesets and looking to get the workitems as well. Any help would be appreciated. Thanks.\nMush — 11 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/15/implementing-release-notes-in-tfs-team-build-2010.aspx#585142\ncan you share the code for this implementation?\nThangarajan — 30 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/15/implementing-release-notes-in-tfs-team-build-2010.aspx#591837\nCould you please share source code for this?\nDharmesh Shah — 26 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/04/15/implementing-release-notes-in-tfs-team-build-2010.aspx#612741\nI really like idea of release repository but there are couple points that I would like to add here.\n\\\nWhat will happen if people forgot to link WorkItems to a given changeset and the build was sucessful? Will this method miss out on such WorkItems which were linked at a later date?\n\\ Generally you have several levels of branches. i.e. Main branch \u0026raquo;\u0026gt; Integration Branch \u0026raquo;\u0026gt; Development Branch in a given hierarchy. Developers check-in against Tasks in development branch and then merge those changesets into integration branch against CR / User Story / Product Backlog Item / etc. In this case, you want to generate release report from Integration / Main branch based on merged changeset which are linked to given type of workitem.\n\\ Finally, different stakeholders / users / teams will be interested in different type of information. Build activity task generates \u0026ldquo;associated workitem\u0026rdquo; information but with limited amount of data in it. I would suggest you to try out an external application that can generate changelog / release notes automatically from TFS. You can find it at http://tfschangelog.codeplex.com/ TFSChangeLog application does not integrate with your automated build process (atleast not at this stage) but it can produce changelog on demand. One good thing about this application is that it does allow users to specify their changeset range (i.e. starting point and ending point within a given branch) and then it generates report by extranding changeset information and associated workitems information from the specified range. TFSChangeLogCL.exe is the command line interface to this very same functionality. You will have to pass in XML file as parameter which has TFS server, project, branch, FromChangeSet and EndChangeSet information. It can then generate output in XML and then transform it using XSLT 2.0 into HTML. TFSChangeLog is tested against TFS 2010 at this stage as it uses newly supported Branch Objects.\nHope this will be useful for your projects.\nBest Regards,\nDharmesh Shah.\\ ","permalink":"https://blog.ehn.nu/2010/04/implementing-release-notes-in-tfs-team-build-2010/","summary":"\u003cp\u003eIn 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.\u003c/p\u003e","title":"Implementing Release Notes in TFS Team Build 2010"},{"content":"Yesterday I upgraded my dev laptop to VS 2010 RC. To upgrade to VS 2010 RC you need to first uninstall VS 2010 Beta 2 (which doesn’t really make it an upgrade does it? :-)\nI also hade an instance of TFS 2010 Beta 2 om my machine so I uninstalled that as well. The installation of VS 2010 went fine, and then I installed Team Explorer 2010 RC. However, when starting VS and switching to the team explorer, I got the following error:\nCould not load type \u0026lsquo;Microsoft.TeamFoundation.Client.TeamFoundationServerBase\u0026rsquo; from assembly \u0026lsquo;Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\u0026rsquo;.\nIt turns out that I still had one Beta 2 installation left, namely the TFS 2010 Beta 2 Power Tools. After uninstalling this everything works as expected.\nSo, the first impression on VS 2010 RC is good, it is definitelyt faster in startup and loading time. Haven’t really measured build time etc. yes. Unfortunately working with the Workflow Designer (for TFS 2010 Builds) is still painfully slow. On my Dell 2.5GHz 4GB RAM laptop it takes almost 40 seconds to load the default build process template!\nI hope that the RTM will improve the performance when it comes to the WF designer, otherwise we will have to resort to editing the .XAML files directly which if course isn’t as nice (and no intellisense yet!)\nComments Imported from the original WordPress site. Closed for new replies.\nMichel Prevost — 31 Mar 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/02/09/reember-to-uninstall-all-beta-2-stuff-before-upgrading-to.aspx#513804\nI have the same problem, but I never installed the Beta 2 tools.\nHamid — 09 Apr 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2010/02/09/reember-to-uninstall-all-beta-2-stuff-before-upgrading-to.aspx#514656\nThanks Jakob,\nThat worked a treat. Although, I had uninstalled TFS2010 Beta2 but I still had PowerTools Beta2 installed on my machine. Uninstalled them and this issue is resolved.\\\n","permalink":"https://blog.ehn.nu/2010/02/reember-to-uninstall-all-beta-2-stuff-before-upgrading-to-vs-2010-rc/","summary":"\u003cp\u003eYesterday I upgraded my dev laptop to VS 2010 RC. To upgrade to VS 2010 RC you need to first uninstall VS 2010 Beta 2 (which doesn’t really make it an upgrade does it? :-)\u003c/p\u003e\n\u003cp\u003eI also hade an instance of TFS 2010 Beta 2 om my machine so I uninstalled that as well. The installation of VS 2010 went fine, and then I installed Team Explorer 2010 RC. However, when starting VS and switching to the team explorer, I got the following error:\u003c/p\u003e","title":"Reember to uninstall all Beta 2 stuff before upgrading to VS 2010 RC"},{"content":"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. 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)\nIn TFS 2010, the concept of build controllers were introduced. A build controller belongs to one (1) project collection and is responsible of managing a set of build agents, thereby enabling a build agent pool which allows for builds to execute in parallel, even in the same team project.\nThe build controller also have features for selecting an appropriate build agent for a particular build. For example you can assign a set of tags to a build agent. A tag is just a string, and typically relate to some configuration/environment that is present on the machine of the build agent. For example you might have one build agent that builds BizTalk server projects, for which you need to install the appropriate tools on that machine. Then you tag the build definitions that build biztalk projects with the corresponding tag. This will cause the build controller to select the appropriate build agent.\nYou can of course have several buiuld agents with the same tag(s), thereby creating a build pool that will enable parallall builds for this type of projects as well.\nBy default, when installing/upgrading to TFS 2010 you will configure one 1 build controller and 1 build agent. As said before, the build agent no longer has any dependency to a team project. This means that if you have one build agent all builds for that project collection will be queued on the same build agent and the will not run in parallell. To enable parallell builds, open the TFS Administration Console in the build server and create one (or several) new build agent for the controller. By default, the controller will first try to find a build agent that is free and queue the build on that build agent. If all build agents are busy, the build will just be queued on the build agent with the smallest queue.\nAt our company, we have some builds (from TFS 2008) that actually have a problem with running in parallell with other builds. For example, some builds creates a SQL database during the build to be able to execute integration tests as part of the build. The same scripts are used by the developer to create a local sandbox environment on their development machines. The problem here we typically have several builds for the same project (CI, Nightly, Release) and all of these will create the same database as part of the build. If two of these builds would run in parallell, you can easily imagine some weird errors that would occur!\nTo resolve this, we can use the tag functionality, to map these build definitions to the same build agent. This will cause these builds to be executed in sequence. Since we have a lot of team project and a lot of build definitions, this require some extra management. Both to create new build agents for a new team project with the corresponding tag and to assign the same tag to the builds in the team project.\nTo show how this can be done using the API, I wrote a small application that runs through all team projects on a given TFS project collection. For each team project, it checks if there is a corresponding build agent with the same name. If not, the agent is created and a tag with the same name as the team project is assigned to the build agent.\nNext, it runs through all build definitions for each team project and assign the corresponding tag to those builds. It is a command line tool, so we can run this on a scheduled basis to keep all build agents and build definitions in sync. You will see from the sample that using the TFS API is very simple and intuitive. The only exception here was to read and modify the Tags property for a build definition. This is stored instide the Agent Settings object which is stored as a serialized dictionary. There is rather ugly code to access this information, this could probably be done differently.\nHere is the code, enjoy :-)\nusing System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.TeamFoundation.Server; using Microsoft.TeamFoundation.Build.Client; using Microsoft.TeamFoundation.VersionControl.Client; using Microsoft.TeamFoundation.Client; using System.Xml.Serialization; using System.IO; using System.Xml.Linq; namespace TFSBuildAgentManager { class TFSBuildAgentManager { private static string BuildAgentWorkingDirectory = @\u0026#34;D:Build$(BuildAgentId)$(BuildDefinitionPath)\u0026#34;; static void Main(string[] args) { if (args.Length != 1 \u0026amp;\u0026amp; args.Length != 2) { Console.WriteLine(\u0026#34;Usage: TFSBuildAgentManager.exe tfsServerUrl [buildAgentWorkingDirectory]\u0026#34;); return; } string tfsServer = args[0]; if( args.Length == 2 ) BuildAgentWorkingDirectory = args[1]; TeamFoundationServer tfs = new TeamFoundationServer(tfsServer); tfs.EnsureAuthenticated(); IBuildServer bs = (IBuildServer)tfs.GetService(typeof(IBuildServer)); ICommonStructureService css = (ICommonStructureService)tfs.GetService(typeof(ICommonStructureService)); ProjectInfo[] projectList = css.ListAllProjects(); var controller = bs.QueryBuildControllers(true).First(); foreach (var project in projectList) { string projectName = project.Name; if (bs.QueryBuildDefinitions(projectName).Count() != 0) { var agents = controller.Agents.Where(a =\u0026gt; a.Name == projectName); if (agents.Count() == 0) { IBuildAgent agent = AddBuildAgent(controller, projectName); agents = new List\u0026lt;IBuildAgent\u0026gt; { agent }; } foreach (IBuildAgent a in agents) { if (!AgentHasTag(projectName, a)) { AddTagToBuildAgent(projectName, a); } } foreach (IBuildDefinition build in bs.QueryBuildDefinitions(projectName)) { AddTagToBuildDefinition(projectName, build); } } } } private static bool AgentHasTag(string projectName, IBuildAgent a) { return a.Tags.Where(t =\u0026gt; t == projectName).Count() != 0; } private static IBuildAgent AddBuildAgent(IBuildController controller, string projectName) { IBuildAgent agent = controller.ServiceHost.CreateBuildAgent(projectName, BuildAgentWorkingDirectory); controller.AddBuildAgent(agent); agent.Save(); return agent; } private static void AddTagToBuildDefinition(string tag, IBuildDefinition build) { const string AgentSettingsElement = \u0026#34;{clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow}AgentSettings\u0026#34;; XDocument doc = XDocument.Parse(build.ProcessParameters); var agentSettings = doc.Root.Descendants(AgentSettingsElement); if (agentSettings.Count() == 0) { doc.Root.Add( new XElement(AgentSettingsElement, new XAttribute(\u0026#34;{http://schemas.microsoft.com/winfx/2006/xaml}Key\u0026#34;, \u0026#34;AgentSettings\u0026#34;), new XAttribute(\u0026#34;Tags\u0026#34;, tag))); } else { var tags = agentSettings.First().Attributes(\u0026#34;Tags\u0026#34;); tags.First().Value = tag; } build.ProcessParameters = doc.ToString(); build.Save(); } private static void AddTagToBuildAgent(string tag, IBuildAgent a) { a.Tags.Add(tag); a.Save(); } } } Comments Imported from the original WordPress site. Closed for new replies.\nPatrick Carnahan — 20 Jan 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/12/08/tfs-2010-ndash-managing-build-agents-using-the-api.aspx#502561\nJust wanted to follow up on your non-code content. You mentioned that you were using tags to essentially make all builds that deploy a database use the same agent, effectively serializing their execution. There is another way to accomplish this .. we provided an activity called SharedResourceScope that may be used to lock any resource which is identified by a user-defined string. This allows a secondary locking mechanism for global resources, such as publishing to the symbol store (if you take a look at the default template you will actually find where we use this to synchronize invocations of the PublishSymbols activity on a per-share basis.\nArshad — 11 May 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/12/08/tfs-2010-ndash-managing-build-agents-using-the-api.aspx#518955\nI have a question. Suppose I have some build definition called \u0026ldquo;Continuous.Script.Deploy\u0026rdquo;. The purpose of this build is to deploy latest scripts on all build agents, so that all other builds which need these scripts will always use the latest.\nI was able to do it with TFS 2008 API as I can create a build request and queue the build on all available agent for that project. But in TFS 2010 there is \u0026ldquo;build controller\u0026rdquo; in between to which we can request to queue build. And build controller will queue it only once on a free build agent in its pool.\nSo, is there any way we can queue a particular build on all pooled build agent agents using TFS 2010 API?\nThank you in anticipation.\nJakob Ehn — 11 May 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/12/08/tfs-2010-ndash-managing-build-agents-using-the-api.aspx#518990\nArshad:\nWhen queuing a build, you can use the Name filter in the Agent settings to specify what agent to execute the build on. Set this filter when queueing the build using the API and you should be fine\n/Jakob\nArshad — 13 May 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/12/08/tfs-2010-ndash-managing-build-agents-using-the-api.aspx#519474\nJakob:\nThank you. Your suggestion worked for me. And also helped me to explore TFS API more..!!\ntim — 04 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/12/08/tfs-2010-ndash-managing-build-agents-using-the-api.aspx#546014\nI\u0026rsquo;m trying to do something similar - but using the TFS Build Workflow Template.\nI have 2 build agents: 1 for building Manual builds and 1 for scheduled and CI builds.\nIn the default template there is an AgentSettings argument. I\u0026rsquo;m adding BuildDetail.Reason.ToString() to the AgentSettings.Tags collection so that the correctly tagged build agent can run the build, however this doesn\u0026rsquo;t seem to be working. The build agents seem to be just ignoring the tags. Any idea whats going on?\n","permalink":"https://blog.ehn.nu/2009/12/tfs-2010-managing-build-agents-using-the-api/","summary":"\u003cp\u003eIn 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. \u003cbr\u003e\nIn 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)\u003c/p\u003e","title":"TFS 2010 – Managing Build Agents using the API"},{"content":"We are in the process of upgrading the entire company to TFS 2010 Beta 2, and in preparing for that we have done some test upgrades to make sure that all things work as expected after the upgrade. As expected, most issues that turned up had to do with builds. This is one of the areas that has changed the most compared to TFS 2008. I thought that I would use this post to run through some of the issues that we found.\nFirst of all, when upgrading a TFS 2008 to TFS 2010 Beta 2, all build definitions will be upgraded. They will all be redefined to use the UpgradeProcessTemplate build process template in the new Windows Workflow based build engine. Jim Lamb has a good post that describes this here http://blogs.msdn.com/jimlamb/archive/2009/11/03/upgrading-tfs-2008-build-definitions-to-tfs-2010.aspx\nA nice feature is that you can still use Visual Studio 2008 to create new build definitions in a TFS 2010 server. Under the surface, this will create a build definition using the UpgradeBuildProcess template and it will check in the TFSBuild.proj/rsp files for you. So it will actually be easier to use VS2008 to do this rather than VS 2010, when creating builds targeting legacy MSBuild builds.\nSo, what issues did we run into after the upgrade?\nMicrosoft.TeamFoundation.Build.Client.BuildServerException: Updating build information is not supported from this client. Please use a client compatible with Team Foundation Build Codename Rosario and try again\nWhen running our release builds, most of them failed after the upgrade with this error message. It happened in several different custom build tasks that we have developed inhouse. The thing they had in common was that they were trying to update the running build. For example when adding/updating build steps using the InformationNodeConverter.AddBuildStep method. Also when attaching custom build data using the IBuildInformationNode interface we got the same error.\nActually this error message is the same that you get when trying to work against a TFS 2010 Beta 2 instance from a VS2008 client that does not have the VSTS 2008 SP1 Forward Compatibility Update installed. Even with the upgrade installed there are still things that can’t be done using VSTS 2008. For example you can create a new build definition from a VSTS 2008 client, but you can’t edit it. Try and you will get this dialog:\nThe problem for our build tasks are of course that they were still compiled against the old 9.0 version of the TFS API assemblies. You need to reference the 10.0 version of these assemblies, and the only place that I have been able to locate them at so far is at: %PROGRAMFILES%Microsoft Visual Studio 10.0Common7IDEReferenceAssembliesv2.0:\nThe version of these assembies are 10.0.21006.1. I would assume that these assemblies was installed somewhere when installing the Forward Compatibility Upgrade but I haven’t found them anywhere so far.\n**The command \u0026ldquo;\u0026rdquo;\u0026hellip;.Common7IDEtf.exe\u0026quot; checkout /recursive xxxxxx exited with code 3 **This was another problem that turned up after the upgrade. We use the tf.exe command line tool a lot during builds. For example we check out and in files, we create and modify workspaces etc. In our 2008 build definitions we define a property that contains the full path to tf.exe like this:\n\u0026quot;$(TeamBuildRefPath)..tf.exe\u0026quot;\nTeamBuildRefPath is a Team Build property that provides the path to Team Build binaries (the logger, tasks, etc.). Typically %ProgramFiles%Microsoft Visual Studio 9.0Common7IDEPrivateAssemblies. But in TFS 2010 Beta 2 this property has been changed which of course breaks the builds using it like this. We can see where this change is done by looking at the file TFSBuild.rsp that is generated on the fly by Team Build and is located in the BuildType folder. This file contains all the properties that are used when running MSBuild on the TFSBuild.proj file and is a miz of generated properties and the ones that you can define in your own TFSBuild.rsp file in source control. Here is a sample of this file:\nBegin Team Build Generated Arguments /dl:BuildLogger,\u0026ldquo;C:Program FilesMicrosoft Team Foundation Server 2010ToolsMicrosoft.TeamFoundation.Build.Server.Logger.dll\u0026rdquo;;\u0026ldquo;BuildUri=vstfs:///Build/Build/43;TFSUrl=http://tfsrtm08:8080/tfs/DefaultCollection;TFSProjectFile=C:Builds2projectxxxxBuildTypeTFSBuild.proj;InformationNodeId=2769;LogFilePerProject=False;\u0026quot;*BuildForwardingLogger,\u0026ldquo;C:Program FilesMicrosoft Team Foundation Server 2010ToolsMicrosoft.TeamFoundation.Build.Server.Logger.dll\u0026rdquo;;\u0026ldquo;BuildUri=vstfs:///Build/Build/43;TFSUrl=http://tfsrtm08:8080/tfs/DefaultCollection;TFSProjectFile=C:Builds2projectxxxBuildTypeTFSBuild.proj;InformationNodeId=2769;\u0026rdquo; /fl /flp:\u0026ldquo;logfile=C:Builds2projectxxxxBuildTypeBuildLog.txt;encoding=Unicode;verbosity=normal;\u0026rdquo; /p:ProjectFileVersion=\u0026ldquo;3\u0026rdquo; /p:BuildDefinition=\u0026ldquo;xxxx\u0026rdquo; /p:BuildDefinitionId=\u0026ldquo;5\u0026rdquo; /p:DropLocation=\u0026quot;\\TFSRTM08Drop\u0026rdquo; /p:BuildProjectFolderPath=\u0026quot;%24/project/xxxxxx/Main/Build/Test\u0026quot; /p:BuildUri=\u0026ldquo;vstfs:///Build/Build/43\u0026rdquo; /p:TeamFoundationServerUrl=\u0026quot;http://tfsrtm08:8080/tfs/DefaultCollection\u0026quot; /p:TeamProject=\u0026ldquo;project\u0026rdquo; /p:BuildAgentName=\u0026ldquo;TFSRTM08 - Agent1\u0026rdquo; /p:MachineName=\u0026ldquo;TFSRTM08\u0026rdquo; /p:BuildAgentUri=\u0026ldquo;vstfs:///Build/Agent/2\u0026rdquo; /p:BuildDirectory=\u0026ldquo;C:Builds2projectxxxxx\u0026rdquo; /p:BuildAgentId=\u0026ldquo;2\u0026rdquo; /p:SourceGetVersion=\u0026ldquo;C10\u0026rdquo; /p:LastGoodBuildLabel=\u0026ldquo;xxxxx” /p:LastBuildNumber=\u0026ldquo;xxxxx_20091116.4\u0026rdquo; /p:LastGoodBuildNumber=\u0026ldquo;xxxxx_20091110.4\u0026rdquo; /p:NoCICheckInComment=\u0026quot;%2a%2a%2aNO_CI%2a%2a%2a\u0026rdquo; /p:IsDesktopBuild=\u0026ldquo;False\u0026rdquo; */p:TeamBuildRefPath=\u0026ldquo;C:Program FilesMicrosoft Team Foundation Server 2010Tools\u0026quot; */t:EndToEndIteration\nEnd Team Build Generated Arguments Begin Checked In TfsBuild.rsp Arguments This is a response file for MSBuild \\ Add custom MSBuild command line options in this file End Checked In TfsBuild.rsp Arguments So the TeamBuildRefPath now points to the Tools folder below the TFS 2010 install folder. But tf.exe is typically installed at C:Program FilesMicrosoft Visual Studio 10.0Common7IDE. At the moment, we have resorted to redefining our TF property by using the full path which of course is not a very good solution. But it works, until we find what other MSBuild property we can use to reference to the 10.0 path\n**Work Items are not associated with builds **When running builds, we noticed that sometimes the workitems that had been associated with the changesets for the build were not associated with build. When looking more closely on the build log, this warning were generated:\nC:Program FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets (1162): TF42093: The work item xxx could not be updated with build information. The field Microsoft.VSTS.Build.IntegrationBuild is not available on this work item.\nThis turned out to be a known bug in TFS Beta 2 and affects all work item types that do not have the Microsoft.VSTS.Build.IntegrationBuild field. At the moment there is no work around for this problem than to add this field to all your work item types.\nAside from these problems, the upgraded builds works fine in TFS 2010 Beta 2, which is reassuring because we can still use our investments in the TFS 2008 build process. WE are about to migrate our build process to 2010, using Windows Workflow instead of MSBuild, but this means that we don’t have to do this immediately.\nComments Imported from the original WordPress site. Closed for new replies.\nNilesh — 04 Jan 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/11/24/tfs-2010-beta-2-ndash-upgrading-builds-from-tfs-2008.aspx#500888\nI have one question regarding TFS migration.\nWe have TFS 2008 installed on Windows Server 2003 with domain xyz.com. Now we want to migrate our Database from TFS 2008 to TFS 2010 Beta2 but on a different domain named abc.com.\nIs it possible to migrate TFS database from One domain to another?\nCan you please help me how to perform it.\n","permalink":"https://blog.ehn.nu/2009/11/tfs-2010-beta-2-upgrading-builds-from-tfs-2008/","summary":"\u003cp\u003eWe are in the process of upgrading the entire company to TFS 2010 Beta 2, and in preparing for that we have done some test upgrades to make sure that all things work as expected after the upgrade. As expected, most issues that turned up had to do with builds. This is one of the areas that has changed the most compared to TFS 2008. I thought that I would use this post to run through some of the issues that we found.\u003c/p\u003e","title":"TFS 2010 Beta 2 – Upgrading Builds from TFS 2008"},{"content":"Disclaimer: This blog post discusses features in the TFS 2010 Beta 1 release. Some of these features might be changed in the RTM release.\nIn TFS 2010, Microsoft has changed the build orchestration language in Team Build from MSBuild to Windows Workflow 4.0. Aaron Hallberg has written a post on how to implement a custom workflow activity using either the workflow designer or using a code activity that composes an activity. In this post, I will show how to implement a “pure” code activity, i.e. no workflow elements,and how to add this activity to a build process definition. Note, this is still Beta 1, and some things will definitely change when Beta2 and RTM arrives but this will get you started with customizing your builds in TFS 2010.\nHere is a very simple custom activity that has one input variable, CurrentBuild of type IBuildDetail, and has a string result value. All it does is return the build number of the IBuildDetail object as a string result. This is of course quite useless, but never the less it shows you how to send in variables from your build process workflow and return result back:\npublic class WriteBuildNumberActivity : CodeActivity\u0026lt;String\u0026gt; { [Browsable(true)] [DefaultValue(null)] public InArgument\u0026lt;IBuildDetail\u0026gt; CurrentBuild { get; set; } protected override void Execute(CodeActivityContext context) { string buildNumber = \u0026#34;BuildNumber: \u0026#34; + this.CurrentBuild.Get(context).BuildNumber; context.SetValue(Result, buildNumber); } } Note that the class inherits from CodeActivity, which basically gives it a string return value (OutArgument) called Result.\nNow, to add this activity to a build process, you need to open the build process designer and drag your activity and configure it. This might be a Beta 1 issue, but the only way I got this to work is to include the build process XAML template in the same project that contains the custom activities. This is of course far from ideal, but I am sure that this will resolved in Beta 2.\nSo, first of all create a new build process. Check out my previous blog post on how to do this. Note that since you will customize your build process, you’ll want to create a copy of the standard DefaultTemplate XAML process file. You should never modify the DefaultTemplate.xaml project file. Too make it easy for the sample, you can just place the xaml file in the same folder as your custom activity project.\nNext, include the build process XAML in your library project and then double click the XAML file. This opens up the designer, and of you open the toolbox you should see your custom activity in a separate toolbox tab:\nNext step is to add the activity to your build process. Drag the activity from the toolbox and place it after the UpdateBuildNumber actity:\nSince the activity has an input variable of type IBuildDetail, we need to pass the current BuildDetail object into this variable. To do this, select the activity and edit the CurrentBuildproperty in the properties window to contain the value BuildDetail:\nThe BuildDetail is a variable that is initialized previously in the Get the Build activity at the start of the build process.\nNow save the build process and check it into source control. To be able to run this build on your build agent, the library must of course be available to the build agent. A new approach in TFS 2010 is that you can specify a version control path for custom assemblies on each build controller. This path is where you would store the assemblies that contain custom activities that you want to use in your builds.\nUnfortunately, there seem to be a caching issue in Beta 1 which complicates development. If you modify your activity library and check it in, the old version seem to be cached on the build controller. The only work around that I have found is to clear the version control path field, close the dialog and the reopen it and put the old value back. This seem to cause the build controller to reload the custom assemblies.\nOk, if you have checked in everything, including the custom activity library and configured the build controller, you can now run the build and verify that your activity is being called. In the default log view, you will only see the name of the activity in the list. Too view more info, click on the Show Property Values. This will show all input and output variables for each activity. Note though that it only shows variables that is of standard value types, so it won’t show the CurrentBuild variable:\nAs you can see, the result property contains the string”BuildNumber: “ plus the generated build number that was created previously in the UpdateBuildNumber activity.\nOk, this was a rather contrived and crude example, but it shows how you can create custom code activities and incorporate them into your builds in TFS 2010 Team Build Beta 1. I know many people are interested in how to write “pure” code activites in TFS 2010 for different scenarios, hopefully this post is helpful to get you started!\nFor more on working with custom code activities in WF4.0, read this walkthrough from Guy Burstein: http://blogs.msdn.com/bursteg/archive/2009/05/19/wf-4-0-code-only-custom-activities-for-atomic-actions-codeactivity-codeactivity-t.aspx\nComments Imported from the original WordPress site. Closed for new replies.\nDavid — 13 Aug 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#484633\nNice to see that you are digging into the 2010 details, keep posting!\nmadhurig(msft) — 05 Oct 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#489332\n\u0026lt;Unfortunately, there seem to be a caching issue in Beta 1 which complicates development. If you modify your activity library and check it in, the old version seem to be cached on the build controller. The only work around that I have found is to clear the version control path field, close the dialog and the reopen it and put the old value back.\u0026gt; Workaround is to restart the Build Service Host on the build machine where the controller is running. This issue has been fixed but hasn\u0026rsquo;t made it into Beta2.\nCraig Tadlock — 27 Nov 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#496242\nIm trying to create and use an assembly for custom build workflow activities. Ive followed your instructions above but am unable to get it to work. No matter what I do, I can not get the build process to find my custom assembly. Is there some logging I can turn on for the build service to help debug?\nOther Errors and Warnings\n1 error(s), 0 warning(s)\nTFB210503: An error occurred while initializing a build for build definition TestSunnyside_1.0: Cannot create unknown type \u0026lsquo;{clr-namespace:TadlockEnterprises.TeamFoundation.Build.Workflow.Activities}DeleteFiles\u0026rsquo;.\nDavid Bishop — 30 Nov 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#496486\nI\u0026rsquo;m having the same issue as the above comment:\nTFB210503: An error occurred while initializing a build for build definition ReedBuildActivities: Cannot create unknown type \u0026lsquo;{clr-namespace:BuildActivities}ReedDeploymentActivity\u0026rsquo;.\nDriving me bonkers - been trying to find a workaround for this for some time, now.\nMarkus Schneiders — 01 Dec 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#496683\nI believe you have not Signed your Assembly with an Strong Name. Try this out.\nAleksey Fomichenko — 04 Dec 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#497124\nPlease ensure that you are editing the Process XAML in a separate project, NOT in the same project where you develop your custom build activity.\nSo, under the same solution I have two projects: ActivityLibrary and ProcessTemplates\nHope this helps.\nuk.cv.com — 14 Jun 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#523986\nGreat Post, you’ve done a very nice article, thanks a lot.\nUGG Boots Sale UK — 10 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#546875\nIt\u0026rsquo;s my first time to post a reply, thanks for your sharing\nRecruitment Agency — 24 Nov 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/08/13/tfs-team-build-2010-working-with-custom-code-activities.aspx#549127\nLeading IT recruitment agency based in London, the UK which recruits IT skilled peoples throughout London. Register now!\n","permalink":"https://blog.ehn.nu/2009/08/tfs-team-build-2010-working-with-custom-code-activities/","summary":"\u003cp\u003e\u003cem\u003eDisclaimer: This blog post discusses features in the TFS 2010 Beta 1 release. Some of these  features might be changed in the RTM release.\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eIn TFS 2010, Microsoft has changed the build orchestration language in Team Build from MSBuild to Windows Workflow 4.0. \u003ca href=\"http://blogs.msdn.com/aaronhallberg/default.aspx\"\u003eAaron Hallberg\u003c/a\u003e has written a \u003ca href=\"http://blogs.msdn.com/aaronhallberg/archive/2009/06/01/writing-custom-activities-for-tfs-build-2010-beta-1.aspx\"\u003epost\u003c/a\u003e on how to implement a custom workflow activity using either the workflow designer or using a code activity that composes an activity. In this post, I will show how to implement a “pure” code activity, i.e. no workflow elements,and how to add this activity to a build process definition. Note, this is still Beta 1, and some things will definitely change when Beta2 and RTM arrives but this will get you started with customizing your builds in TFS 2010.\u003c/p\u003e","title":"TFS Team Build 2010: Working with Custom Code Activities"},{"content":"A really cool new feature in VSTS 2010 is Test Impact Analysis which let developers view what tests that are affected by the current code changes. Pieter Gheysens wrote a blog post on how to set this up in the CTP, but things have changed a bit in Beta 1 so I thought that I would show how it is done. Since it still is a bit unintuitive to enable it, it might change once again in the RTM. The reason that it is a bit unintuitive to set it up, is because you need to have the following things:\nYou must use Test Metadata files when running your tests. You can’t use Test Assemblies \\ You must have code coverage enabled in your test settings. VSTS use the code coverage information from a test run to determine which tests that are impacted by a code change. \\ You must setup a team build in TFS with test impact analysis enabled. The build will publish the test results including the code coverage information and VSTS will read information from this build. So, lets set it up:\nFirst you will (obviously) need a solution containing some tests. Note that I don’t explicitly write unit tests here, because it might as well for example web tests. Check in your solution. \\ Enable Code Coverage for you current test settings. See my previous post on how to do this \\ Create a new team build and select your solution. Then set the Analyze Test Impacts parameter to true \\ Select the Test Container TestSettings File and make sure that it is the one in which you have enabled code coverage. In the figure above, I have selected *$/Demo/LibraryWithTests/TraceAndTestImpact.testsettings * Save the build definition and queue a new build. Make sure it finishes successfully and that the tests were executed \\ Now, change some code that you know is called by one or more tests. \\ Switch to the Test Impact View, that is located in the Test –\u0026gt; Windows submenu. First off you can select the button on the top left, called Show Impacted Tests, that will show all tests that are impacted by all your current code changes.In this case, one test was impacted (ImportedMethodTest). When you select the test, you can see in the bottom part of view what code changes that caused the impact The next button is called Show Code Changes and shows the opposite information, e.g. what code changes that has been done, and for each code change it lists the affected test. Note that there is Run Tests link in the view. This is also available as a button. This lets you run all the tests that are affected by your code change. This is a very nice feature, that will speed up your development considerably (at least if you have many tests….) \\ Check in your code change and queue a new build. When the build finishes, open the build summary. This will show you, in addition to the test and code coverage information, what tests that were impacted. If you click the 1 code change(s) link next to the test, a dialog that lists all the methods that had impact on that test is shown \\ Comments Imported from the original WordPress site. Closed for new replies.\nSubodh Sohoni — 24 Jul 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#482747\nGreat posts on TFS 2010 Build and its new features!\nMurthy — 28 Aug 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#485979\nThnks for the info..it was very useful for me\nkidney stones symptoms — 28 Oct 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#492061\nThnks for the info..it was very useful for me\nBlackie — 13 Dec 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#498727\nhow about having it only run tests which have been impacted by the code changes?\nChris Kirschke — 07 Apr 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#514407\nWhat about calling external test tools such as Ounce Labs (now IBM) for a source code security review? We\u0026rsquo;re evaluating TFS 2010 but also leverage Ounce as part of our Secure SDLC process\nkidney stones symptoms — 27 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#535180\nThanks for these useful tips. It is really helpful.\nsymptoms of gallbladder problems — 30 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#555131\nThanks for the useful info!\nColorado Springs Painter — 30 Dec 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#555132\nAwesome detailed information. Thank you.\nMe Too Shoes — 07 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#572702\nNice of you to explain it in great details. Thanks.\nbladder infection symptoms — 07 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#572759\nThat\u0026rsquo;s a really cool features thanks for sharing.\nadmirals cove — 10 Nov 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx#599522\nI can\u0026rsquo;t view you website well. I am using firefox and it is having trouble with alignment.\n","permalink":"https://blog.ehn.nu/2009/06/vsts-2010-enabling-test-impact-analysis/","summary":"\u003cp\u003eA really cool new feature in VSTS 2010 is \u003cem\u003eTest Impact Analysis\u003c/em\u003e which let developers view what tests that are affected by the current code changes. Pieter Gheysens wrote a \u003ca href=\"http://intovsts.net/2009/02/05/test-impact-analysis/\"\u003eblog post\u003c/a\u003e on how to set this up in the CTP, but things have changed a bit in Beta 1 so I thought that I would show how it is done. Since it still is a bit unintuitive to enable it, it might change once again in the RTM. The reason that it is a bit unintuitive to set it up, is because you need to have the following things:\u003c/p\u003e","title":"VSTS 2010: Enabling Test Impact Analysis"},{"content":"There are some changes and improvements in the area of executing unit tests in Team Build 2010. Mostly the changes make it easier to define which unit tests you want to execute as part of the build. In this post I will go through the different options that you have when it comes to running unit tests and enabling code coverage.\nTo configure test settings for a Team Build, you select Edit Build Definition in Team Explorer, and then go to the Build Process tab. In the Build process parameters box there is a section for the testing parameters. To change the parameters, just edit them and hit the save button. There is no need to check anything in or out to change the parameters. Only changes to the build process require you to check in the build process file (.xaml)\n**Running Unit Tests from Test List(s) **If you like to manage your tests using test lists (I don’t!), this option lets you run all the tests from one or more test lists. Here I have created two test lists, ImportantTests and LessImportantTests. Each test list contains two unit tests from two different assemblies.\nTo run all the tests from these test lists in a team build, locate the Test Metadata Files parameter and press the browse button to the right. This brings up a dialog that lets you choose which test metadata files (.vsmdi files) that you want to execute tests from. By default, all the tests will be executed. To filter this, click the Specify Lists button and you can select one or more test lists instead:\n**Running Unit Tests from Test Assemblies (a.k.a. Test Containers) **Since managing test lists in VSTS doesn’t scale very well, a common approach is to use Test Assemblies instead. In previous versions this was called Test Containers. So instead of creating different test lists to group your tests, you create several unit test assemblies and group your unit tests by adding them to the corresponding unit test assembly. For example you can have one (or more) assembly that contain pure unit tests, another set of assemblies that contain integration tests that you might only want to run in your nightly builds. To specify which test assemblies you want to execute, you use the Test Assembly Filespec parameter. This parameters contains a search pattern that should match the names of your test assemblies.\nTo use this approach in your company, you need to define a naming scheme for your unit test assemblies, such as Project.UnitTests.dll, Project.IntegrationTests.dll and so on.\n**\nRunning Unit Tests by Priority **In addition to selecting which unit tests to execute, you can now further filter the tests by using the Priority attribute on your test methods. This is an attribute that has been around since .NET 2.0, but strangely enough there was no support of using it when running tests, neither in Visual Studio or in Team Build. In TFS 2010 however you can define a minimum and maximum test priority for your team build, meaning that all tests with a priority within that range will be executed as part of the build.\nHere is how you decorate your test method with a priority.\n/// \u0026lt;summary\u0026gt; ///A test for ImportantMethod ///\u0026lt;/summary\u0026gt; [TestMethod()] [DeploymentItem(\u0026#34;LibraryWithTests.dll\u0026#34;)] [Priority(1)] public void ImportantMethodTest() { Class1 target = new Class1(); // TODO: Initialize to an appropriate value string arg = \u0026#34;42\u0026#34;; // TODO: Initialize to an appropriate value int expected = 42; // TODO: Initialize to an appropriate value int actual; actual = target.ImportantMethod(arg); Assert.AreEqual(expected, actual); } Then, set the priority range in your build definition \\\nNote that this is an additional filter that is applied to, in this case, all unit tests in all test assemblies that end with UnitTests.dll.\n**\nRunning Unit Tests by Category **In addition to Priority, you can also filter your tests by using categories. This is very similar to priorities, but instead of working with numeric ranges, you define categories with meaningful names and apply them to your test methods.\nTo use this approach, decorate your test methods with the TestCategory attribute and then specify one or more test categories in your build definition.\nAccording to the tooltip you should be able to construct the filter by using logical operators such as \u0026amp; and | , but this doesn’t seem to work in Beta 1.\n*Enabling Code Coverage in a Team Build *\nWhen running unit tests you normally want to know how much of your code is actually tested, a.k.a. code coverage. The way you enable this for your tests and in your team build has changed a bit. First, the previous *.testrunconfig files has been renamed into *.testsettings. To enable code coverage, double click on your .TestSettings file and select the Execution Criteria tab. Here you will see a totally new Collectors section that contains information about what data you want to collect when executing test. One of them is code coverage. The GUI is a bit weird in Beta 1, since you are supposed to first select the Code Coverage checkbox, and then click the Advanced button to specify which assemblies that should be instrumented for code coverage.\nNext, in your team build definition you must specify the name of the test settings file you want to use. This is done using the Test Container TestSettings File parameter. Save the build definition, check in the test settings file and queue a new build. When it has finished, open the build summary that will show you the numbers on number of executed/passed/failed tests, and also the overall code coverage.\nVery nice summary view indeed! If you want to look at the test results in detail, you click the “View Test Results” link which will download the test run to your local machine and then open it in the Test Results window.\nComments Imported from the original WordPress site. Closed for new replies.\nBob Hardister — 24 Jul 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#482723\nGreat post! Just what I was looking for. Where did you find the guidelines for this?\nMathieu Hétu — 11 Jun 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#523673\nHowever, it will only work if on the build machine Visual Studio 2010 Ultimate or Premium is installed.\nWhich is a silly requirement IMO.\nThanks for the documentation!\nDustin Andrews — 14 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#537814\nWhat if I am building more than one solution file in my build? How can I add more assemblies to be instrumented in the build?\nJakob Ehn — 14 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#537881\nDustin: the output from all solutions will end up in the same location during team build, so if you use the Test Container extension (Test.dll for example) Team Build will find the test assemblies from all solutions\nSonali Noolkar — 01 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#560436\nI am trying to execute unit tests as a post build event using TFS2010 upgrade template. I tried to modify the TFSBuild.proj file to include below lines.\ntrue\n$(SolutionRoot)/LocalTestRun.testrunconfig\nAfter this, I am getting below errors:\n2 error(s), 0 warning(s)\n$/AO SDMC.NET/TeamBuildTypes/WebApplicationStarterKit4_CI/TFSBuild.proj (\u0026lsquo;TestConfiguration\u0026rsquo; target(s)) - 2 error(s), 0 warning(s), View Log File\nC:Program Files (x86)MSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets (1375): The \u0026ldquo;Version\u0026rdquo; parameter is not supported by the \u0026ldquo;TestToolsTask\u0026rdquo; task. Verify the parameter exists on the task, and it is a settable public instance property.\nC:Program Files (x86)MSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets (1361): The \u0026ldquo;TestToolsTask\u0026rdquo; task could not be initialized with its input parameters. Please help.\nSonali Noolkar — 01 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#560440\nTo add further,\nAs described in the article, why the Testing Parameters section is not visible to me?\nI am using VS2010 Ultimate version.\nArunkumar — 22 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#564238\nHey I am not getting Execution Criteria option in visual studio 2010 ultimate.\nJakob Ehn — 22 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#564241\n@Sonali: This post was written for the Beta 1 release so the GUI has changed since then. You\u0026rsquo;ll find the settings in the process section, Build process parameters -\u0026gt; Basic -\u0026gt; Automated Tests. Click the \u0026ldquo;\u0026hellip;\u0026rdquo; browse button and select the Criteria/Arguments tab\nCheers\n/Jakob\nibs symptoms — 02 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#576431\nThank you for the clarification. Regards, Larry\nNicolae — 09 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#577248\nHello, thank you for the article,\nI have on question, why I can\u0026rsquo;t see the \u0026ldquo;Automated Tests\u0026rdquo; under the \u0026ldquo;Build process parameters -\u0026gt; Basic\u0026rdquo; ?\n\u0026mdash;\u0026mdash;\u0026mdash;\u0026mdash;-\n@Sonali: This post was written for the Beta 1 release so the GUI has changed since then. You\u0026rsquo;ll find the settings in the process section, Build process parameters -\u0026gt; Basic -\u0026gt; Automated Tests. Click the \u0026ldquo;\u0026hellip;\u0026rdquo; browse button and select the Criteria/Arguments tab\nCheers\n/Jakob \\\nVLetroye — 23 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#590934\nOnce you have clicked the “View Test Results” link which downloads the test run on your local machine and open it in the Test Results window, you can next open each test results. Assuming that you open a failed test, you can see the related error Stack Trace with hyperlinks for each line of your code. Unfortunatelly, these hyperlinks are referencing sources in local paths on the Build server\u0026hellip; Isn\u0026rsquo;t there a way to replace this with a link to the Symbol Server, so that one can open the sources from our workstations ? (Indeed, we possibly don\u0026rsquo;t have the same version of the sources in our workspace and anyway, our workspace does not map the sources on the same path as the various Build agents)\u0026hellip;\nGangadhar — 20 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/06/03/tfs-team-build-2010-running-unit-tests.aspx#597354\nHi Jakob,\nI have a task to integrate unit tests with TFS build\nI have followed all the steps as you mentioned in the above article. when i queue the build it is successful but the test runs are showing up as zero.\nI didn\u0026rsquo;t find any flag like testrun=\u0026lsquo;True\u0026rsquo; in the tool. so i made true in the TFSBUild and queued the build, no test runs :(.\ncan u please help me in this. Regards,\nGangadhar.\n","permalink":"https://blog.ehn.nu/2009/06/tfs-team-build-2010-executing-unit-tests/","summary":"\u003cp\u003eThere are some changes and improvements in the area of executing unit tests in Team Build 2010. Mostly the changes make it easier to define \u003cstrong\u003ewhich\u003c/strong\u003e unit tests you want to execute as part of the build. In this post I will go through the different options that you have when it comes to running unit tests and enabling code coverage.\u003c/p\u003e\n\u003cp\u003eTo configure test settings for a Team Build, you select Edit Build Definition in Team Explorer, and then go to the Build Process tab. In the Build process parameters box there is a section for the testing parameters. To change the parameters, just edit them and hit the save button. There is no need to check anything in or out to change the parameters. Only changes to the build process require you to check in the build process file (.xaml)\u003c/p\u003e","title":"TFS Team Build 2010: Executing Unit Tests"},{"content":"*Disclaimer: This blog post discusses features in the TFS 2010 Beta 1 release. Some of these features might be changed in the RTM release. *\nIn my last post I talked about the new major features of Team Build in TFS 2010. This time, I will go into more detail on how you work with build definitions. In TFS 2010, the whole build process is now implemented on top of Windows Workflow Foundation 4.0 (WF4). This means that everything that has to do with creating and customizing builds in TFS 2010 is now done using a workflow designer UI. This means that you no longer have to remember all the different MSBuild targets when you want to insert some custom logic in your build. On the other hand, you obviously need to understand how a default team build process is implemented, which activities does what, what WF properties and variables that exist. And eventually you might also have to learn how to implement custom workflow activites when you need more functionality than what is included in the standard team build activities.\nNote that MSBuild is still used to actually compile all the projects. The output from the compilations are available in a separate log file that is available from the build summary view.\nSo, lets create a new build definition. When you select the New Build Definition menu item, you get a dialog that looks very much like the one in TFS 2008.\n**General **This tab just contains the name and the description of your build. There is also a checkbox that lets you disable the build definition, in case you want to work on it more before making it enabled.\n**Trigger **Here you define how this build should be queued. The only new option here in 2010 is Gated Check-in, which is a very cool feature that will stop you from check in in anything that breaks the build.\nWorkspace This tab has not changed since 2008. Here you define the workspace for the build, i.e. what part of the source control tree that should be downloaded as part of the build. Here I set the $/Demo/WpfApplication1 as my workspace root. You always want to make your workspace as small as possible to speed up build time.\n**Build Defaults **In the previous version of Team Build you select which build agent that should run the build. In 2010, you now select a Build Controller. The build controller manages a pool of build agents that will be selected by an algorithm that takes into account the queue length on each build agent, in a round-robin fashion (although this algorithm is not yet documented, and it is not clear if you can implement your own algorithm)\nIn addition to must enter the drop location for the build.\nProcess\nNow we come to the interesting part! Here you select the Build process file, which is a Windows Workflow XAML file that must be located somewhere in your TFS source control repository. By default for all new team projects, there are two build process files created automatically, DefaultTemplate and UpgradeTemplate. The default template is the standard Team Build process, with the get, label, compile etc.. The UpgradeTemplate process file can be used to execute legacy builds, i.e. TFSBuild.proj files.\nThis functionality, e.g. selecting a build process template from a list, is in itself a nice improvement from earlier versions where you always had to create a standard build process and the modify the TFSBuild.proj accordingly. (Lots of people instead wrote applications that create TFSBuild.proj programattically to simplify the process).\nHowever, you should not use the default template as the process file for your builds. Instead you should create a new template from the default template and use this one instead. You do this by clicking on the New button:\nThis mechanism lets you create a set of build process templates (for example you can have one template for CI builds, one for nightly builds, one for relase builds etc… These templates can be stored in a dedicated location in source control and any changes to them should only be allowed for the build managers. Application developers can then setup new builds from the existing templates and should only need to modify the parameters (see below) which are not part of the template but stored together with the build definition.\nYou can view and/or edit the build process file by clicking the link which takes you to the source control explorer, then double-click the xaml file to open it up in the workflow designer. The following (slightly MSPaint hacked) screen shot show you the top level process of the DefaultTemplate build process:\nYou can drill-down into the different activities to see how the process is designed. In my next post I will show how to customize the build process by adding new activities to it.\nWhen you have selected the build process template, you then go through the parameters of the build. The properties are defined in the build process as arguments to the workflow and corresponds to the MSBuild properties in the previous versions. If you have used team build before, you’ll definitely recognize many of the properties. The most important ones are:\nBuild Process Parameter Meaning Sample Projects to Build The list of build projects Configurations to Build The list of configurations to build, on the format configuration platform Build Number Format The format of the unique build number that is generated for each build $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r) Clean Workspace Controls what artifacts that should be deleted before the build starts. All – Deletes both sources and outputs (Full rebuild) Outputs – Deletes outputs, and get only the sources that have changed (Incremental Get) None = Leave existing outputs and sources in place (Incremental Build) MSBuild Arguments Additional command line arguments to pass to MSBuild.exe. /p:Configuration=Debug Associate Changesets and Work Items Control if Team Build should associate changesets and work items with the build True/False. Consider False for continuous builds to speed them up. **Retention Policy **In this tab you select how builds should be retained. Note that you now can select a different configuration for manual/triggered builds and private build.Private here means builds with the Gated Check-in trigger enabled. You will typically want to retain fewer private builds compared with the manual/triggered builds:\nOk, you are done! Save the build definition and queue a build in the team explorer. When the build finishes, double click it to see the Build summary view:\nFor a detailed view of the build, click the View Log link:\nA nice feature here is the Show Property Values link. This show the log, but in addiotn it shows each in/out property for each activity. This is very useful when trying to troubleshoot a failing build:\nOK, this was a quick walkthrough of how to create a basic build definition in Team Build 2010. In my next post, I will show how to customize the build process using the workflow designer!\nComments Imported from the original WordPress site. Closed for new replies.\nBob Hardister — 09 Jun 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#476671\nNice start! Would love to see a clean mapping of activity parameters to TFS MS build properties from prior TFS versions.\nCraig Tadlock — 26 Dec 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#500274\nNice site! I\u0026rsquo;ve done a lot of work on customizing the TFS 2010 build process as well\u0026hellip;\nhttp://www.tadlockenterprises.com/?s=tfs+2010+build\nCT\nAndré Gustavo Poffo — 14 May 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#519569\n\u0026ldquo;In my next post I will show how to customize the build process by adding new activities to it.\u0026rdquo;\nWhere\u0026rsquo;s it? :)\nHesheng Bao — 15 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#528617\nDo you have any idea how to launch an external process right after a build completes successfully?\nBuildy — 29 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#530407\nMy upgradetemplate.xaml is not opening in the workflow designer. It is throwing about 50 errors that it does not have reference to system.common and other dlls. is it a common issue.\nMarilou — 02 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#560792\nHi - Great info. I look forward to digging in some more. I\u0026rsquo;m interested in how to let the builder specify a Label to build. So the code ready for release can be labeled, then they can build just the release files. (so changes made to code after the label are excluded). Do you have info on that? The \u0026ldquo;What do you want to build?\u0026rdquo; field is disabled for me.\nmurali — 21 Feb 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#563844\nThere is any way to view the build definition change log. Since some one change my definition of build and i want to know what changes have made and by whom.\nAnil — 11 Aug 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#589461\nThis Explanation is very good for the beginner in the field of VS 2010. I will say it GOOD WORK\nshashank kulkarni — 17 Jan 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#605808\nThis Explanation is very good for the beginner in the field of VS 2010. Thank you.\nAbhijeet — 01 Feb 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#606902\nHi, Actaully i am trying to create a Continous Integration(CI) server. The above article was really helpful and only problem i am facing is how to create a \u0026lsquo;Build process file\u0026rsquo; from scratch. This is first time i am setting a CI server. And have no template file to make a copy of it. Can i get a existing Build process file so that i can customize it as per my requirment\nPeter Thelander — 27 Mar 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#611053\nHi, and thanks for the info. Can you tell me how it is possible to read/write a build definition from the command line, eg using the tf command or similar? Because in our dev environment we have many build definitions, and so working on them through the UI is too time consuming. We need to write a script to make bulk changes to many build definitions. Is it checked in to TFS like other files? or how can it be accessed? Thanks!\nJakob Ehn — 18 Apr 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#612206\n@Peter: If you need to do bulk operations on buildsm check out the Community TFS Build Manager which is perfect for this.\nhttp://geekswithblogs.net/jakob/archive/2011/12/30/introducing-community-tfs-build-manager.aspx\n/Jakob\nPrakash Mishra — 28 May 2014\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/27/working-with-build-definitions-in-tfs-team-build-2010.aspx#638031\nNice and Easy explanation. I have one question regarding the logging of the activities it loads very slow in the TFS. Is there any way to improve it for a good tracing experience or is there any way to save this log details into a text file that will easily help us in tracing the build through log.\n","permalink":"https://blog.ehn.nu/2009/05/working-with-build-definitions-in-tfs-team-build-2010/","summary":"\u003cp\u003e*Disclaimer: This blog post discusses features in the TFS 2010 Beta 1 release. Some of these  features might be changed in the RTM release. *\u003cbr\u003e\nIn my \u003ca href=\"http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx\"\u003elast post\u003c/a\u003e I talked about the new major features of Team Build in TFS 2010. This time, I will go into more detail on how you work with build definitions. In TFS 2010, the whole build process is now implemented on top of Windows Workflow Foundation 4.0 (WF4). This means that everything that has to do with creating and customizing builds in TFS 2010 is now done using a workflow designer UI. This means that you no longer have to remember all the different MSBuild targets when you want to insert some custom logic in your build. On the other hand, you obviously need to understand how a default team build process is implemented, which activities does what, what WF properties and variables that exist. And eventually you might also have to learn how to implement custom workflow activites when you need more functionality than what is included in the standard team build activities.\u003c/p\u003e","title":"Working with Build Definitions in TFS Team Build 2010"},{"content":"VSTS 2010 Beta 1 is finally available. Beta 1 is a huge release a contains tons of new functionality in almost all areas of Team System. We at Osiris Data have been using Team System since the first beta, and we also help our customers how to adopt TFS in their organization. So for us VSTS 2010 is a very exciting release.\nI am planning to post several blog entries about the new functionality of VSTS 2010, in particular I will focus on Team Foundation Server (TFS) and Team Build. I have been working a lot with Team Build 2005 and 2008 and have been looking forward to the 2010 release. VSTS 2008 was a minor release for TFS, so a lot of missing features and change requests haven’t been implemented until now.\nSo, in this blog post I will run through the new functionality in Team Build 2010, and then I will follow up with several blog posts that go into more detail on the different areas.\n**Build Controllers lets you pool your builds **In TFS 2005/2008 you could only assign a team build to one build agent. In 2010, you assign a team build to a Build Controller instead. The Build Controller will now be responsible for managing a custom pool of Build Agents and will select aBuild Agent to run the Team Build The following screenshot show the Manage Build Controllers dialog which in this case show one build controller that contains two build agents.\nOften you need to have several different build agents that have different configurations. For example, you might need .NET 3.5 SP1 on one build agent to be able to build applications that rely on SP1, but then you have apps that still need to be built without SP1 installed. In 2010, you can use tags to tell Team Build which build agent to choose. You create the tags in the Build Agent Properties dialog:\nTo assign a build definition to one or more tags, you use the Agent Requirements property in the process tab of the build definition:\n**Build Process are defined using Windows Workflow 4.0 **Team Build 2005 and 2008 relies solely upon MSBuild to drive the build process. MSBuild is a powerful language designed for building applications. It is also lets you extend the build process by using tasks which are .NET classes that implement a certian interface.\nThe problem with MSBuild is that the learning curve is rather steep, it is quite unintuitive for most people. In addition, Team Build 2005/2008 hides the entire build process in a separate targets file. Although this does hide all the hairy details from the user from , it also makes customizing a team build very complex. The order in which the team build targets are executed is very hard to visualize by just looking at the MSBuild file. One of the most common questions from team build users is I want to run my things after my project is built/tested/dropped, how do I do it?\n2010 to the resuce! The build process of a team build is now completely driven by Windows Workflow 4.0. This means a whole new UI for editing your build process, and you need to learn how to write/use workflow activities when you need to extend your builds instead of MSBuild. Here is a snapshot of parts of a build process in the workflow designer in VSTS 2010, and also the Toolbos with some of the available team build activities:\nYou should recognize most of the activities from the corresponding team build tasks in Team Build 2005/2008. The default build process is still the same, get the sources, label the sources, build the projects, test the projects etc.\nSo now the entire build process is visible when extending a team build. For most times, you don’t have to change the build process itself, but just modify the build properties to fit your needs. There are several new build properties that lets you customize the build that previously was quite difficult/cumbersome:\nI will go into more detail on these properties in an upcoming blog post.\n**Reusing Build Definitions using Build Process Templates **When creating builds for a larger system, you often find yourself defining a set of builds (CI, Nightly, Release etc) for the different applications. These builds are often defined using the exact same (or very similar) build definition process. In TFS 2005/2008, there is no way to easily resuse build definitions as templates for new builds.\nTFS 2010 supports this by adding a feature called Build Process Templates. When creating a new build, you select from a list of build process templates that contain the actual build process. These templates are workflow XAML files that are located in source control in the TeamBuildProcessTemplates folder:\nBy default, there are two build process templates when you create a new team project, DefaultTemplate and UpgradeTemplate. DefaultTemplate is the standard build process that performs a complete build of your app. The UpgradeTemplate is a sort of placeholder build template that is used to execute legacy TFSBuild.proj files. This means that you can still use your existing team build definitions when upgrading to TFS 2010.\nIn a later post, I will show how you can create new build process templates for your particular scenarios, and how to share them between team projects.\n**The Build Summary and Log is now readable! **The Build summary screen has also been completely rewritten and lets you find the problem with the build much faster than in previous versions of Team Build. It also contains much more information, such as build times compared to the 9 previous builds and the list of properties that were sent into the build. Here is a screenshot of the Build Summary and the Activity Log:\nFor more info about these screens, check out Jason Prickett’s blog: http://blogs.msdn.com/jpricket/archive/2009/05/12/tfs-2010-beta1-build-details-view-summary-section.aspx, http://blogs.msdn.com/jpricket/archive/2009/05/18/tfs-2010-beta1-build-details-view-log-view-section.aspx\n**Gated Checkins, a.k.a No More Broken Builds **The gated checkin is a feature that has been requested for a long time and exisst in other build labs. The idea is very simple, when a checkin occurs, you want to ensure that that checkin does not break the build. At certain stages in a project, such as in the stabilization phase, broken builds cause lots of grief with people trying to fix the build to be able to push out a new version of the application to the testers. Team Build 2010 implements this by performing whats known as a Private Build in isolation from the source control system. This means that if the private build is succesful, the checkin will be executed. But if the build fails, the checkin will not be executed.\nYou turn on Gated checkin for a build by modifying the trigger of the build definition: \\\nWhen a user tries to check in something that will trigger this build (e.g. inside the workspace of the build), the following dialog is shown: \\\nIf the checkin affects several builds with the Gated Checkin trigger turned on, the user have to choose one of these builds.\nBtw, there is an open source project on CodePlex that implements a variation of this for TFS 2008 called Buddy Build: http://www.codeplex.com/BuddyBuild\nAlright, I think that is enough for a summary post of the new features of Team Build 2010. As I mentioned previously, I will write several posts where I go into more detail on these new features and how they compare to the existing functionality in TFS 2005/2008.\nHappy building!\nComments Imported from the original WordPress site. Closed for new replies.\nLeo Kushnir — 19 Jan 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#502483\nVery Nice,\nThanks\nDerik Whittaker — 08 Mar 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#508344\nHow do you get the the WWF setup screens when creating a build? I cannot find them anyplace.\nrrr — 31 May 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#521917\nI have installed VS2010 ultimate and tried to create a new build definition using TFS 2010. However, I cannot find the \u0026ldquo;process tab\u0026rdquo;. The Project file is still present, although i cannot create new .proj file. pls healp me,regarding this issue. I suspects, that I have not installed it properly. Or is there anything more i should do, other than just installing the visual studio 2010.\nHao — 06 Jun 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#522985\ni have the same problem with rrr. When i create a new build definition. no \u0026ldquo;process\u0026rdquo; tab, instead there is \u0026ldquo;project file\u0026rdquo; tab.\nJeremy — 20 Jul 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#529186\nThanks dude, the info on the Build Agent Tags hit the spot.\nScott — 03 Aug 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#531331\nJim,\nOur company has a central source repository using TFS2008. We would like to perhaps use our company\u0026rsquo;s central source repository, however we also would like to use Team Build 2010. Is there anyway to somehow get the source out of TFS2008 and still use TFS build 2010 on a separate machine?\nThanks,\nScott\nJakob Ehn — 03 May 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#576603\n@Bill You can install Team Build using the TFS installer. See this link for info: http://msdn.microsoft.com/en-us/library/ms181712.aspx\n/Jakob\nSivaKumar — 12 Oct 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#596628\nNice post, its very useful\nAshu :) — 09 Feb 2012\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/05/23/tfs-team-build-2010-whatrsquos-new.aspx#607475\nExactly what I was looking for\u0026hellip;Thanks for the info :)\n","permalink":"https://blog.ehn.nu/2009/05/tfs-team-build-2010-whats-new/","summary":"\u003cp\u003eVSTS 2010 Beta 1 is finally available. Beta 1 is a huge release a contains tons of new functionality in almost all areas of Team System. We at \u003ca href=\"http://www.osiris.no\"\u003eOsiris Data\u003c/a\u003e have been using Team System since the first beta, and we also help our customers how to adopt TFS in their organization. So for us VSTS 2010 is a very exciting release.\u003c/p\u003e\n\u003cp\u003eI am planning to post several blog entries about the new functionality of VSTS 2010, in particular I will focus on Team Foundation Server (TFS) and Team Build. I have been working a lot with Team Build 2005 and 2008 and have been looking forward to the 2010 release. VSTS 2008 was a minor release for TFS, so a lot of missing features and change requests haven’t been implemented until now.\u003c/p\u003e","title":"TFS Team Build 2010: What’s New?"},{"content":"On May 20th Terje and Mikael from my company (Osiris Data) will hold a seminar in Oslo, Norway where they will run through all (?) the new cool features in VSTS 2010. Expect to see demos on the new functionality for manual and UI testing, branch visualization, hierarchical work items, gated check-ins and lots of other stuff.\nVSTS 2010 is a really huge release and if the rumours are true, the Beta 1 will be released in May, hopefully before the seminar :-)\nCheck out the full agenda and registration details here:\nhttp://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032414271\u0026amp;EventCategory=1\u0026amp;culture=nb-NO\u0026amp;CountryCode=NO\n","permalink":"https://blog.ehn.nu/2009/04/free-seminar-on-visual-studio-team-system-2010-in-oslo-norway/","summary":"\u003cp\u003eOn May 20th \u003ca href=\"http://geekswithblogs.net/terje\"\u003eTerje\u003c/a\u003e and \u003ca href=\"http://twitter.com/Nitell\"\u003eMikael\u003c/a\u003e from my company (\u003ca href=\"http://www.osiris.no\"\u003eOsiris Data\u003c/a\u003e) will hold a seminar in Oslo, Norway where they will run through all (?) the new cool features in VSTS 2010. Expect to see demos on the new functionality for manual and UI testing, branch visualization, hierarchical work items, gated check-ins and lots of other stuff.\u003c/p\u003e\n\u003cp\u003eVSTS 2010 is a really huge release and if the rumours are true, the Beta 1 will be released in May, hopefully before the seminar :-)\u003c/p\u003e","title":"Free Seminar on Visual Studio Team System 2010 in Oslo, Norway"},{"content":"When creating new team projects in TFS, the project is created from a project template, that basically is a set of XML files. Here you can define all your work item types, queries, reports, portal site and some other things. One of the things that you can’t specify here, is what checkin policies that you want to enable for that team project. At our company, we usually create a new team project for every customer so for every new customer we need to manually modify the checkin policies for that project to match our company policy.\nThat is tedious and easy to forget, so it must of course be automated! :-) Since TFS generates a ProjectCreatedEvent every time a team project is created, that seems like a good place to start. In addition we must find a way to enable a checkin policy on a given team project. After quite some searching around, I found a blog post by Buck Hodges that shows the API for reading and updating checkin policies for a team project.\nThe source code for the web service is shownbelow. To add a subscription for the ProjectedCreatedEvent and map it to the web service, use the following command line statement (bissubscribe is installed on the Team Foundation Server app tier): \u0026ldquo;C:Program FilesMicrosoft Visual Studio 2008 Team Foundation ServerTF SetupBisSubscribe.exe\u0026rdquo; /eventType ProjectCreatedEvent /address http://SERVER/NewTeamProjectEventService/NewTeamProjectEventService.asmx /deliveryType Soap /domain http://TFSSERVER:8080\nNote that the web service reads the assembly and the checkin policies (separated by ;) from the app settings. As of now, this only makes it possible to read checkin policies from one assembly, but it should\u0026rsquo;n’t be that hard to extend the code to allow for mutiple assemblies. I will post an update when I have implemented this functionality.\nAlso note that the checkin policies must be installed on the server running the web service. I have not found another way to get a hold of the PolicyType references than to use the Workstation.Current.InstalledPolicyTypes property.\n[WebService(Namespace = \u0026#34;http://tempuri.org/\u0026#34;)] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class NewTeamProjectEventService { [SoapDocumentMethod(Action = http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify, RequestNamespace = \u0026#34;http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03\u0026#34;)] [WebMethod(MessageName = \u0026#34;Notify\u0026#34;)] public EventResult Notify(string eventXml) { try { XmlDocument objXML = new XmlDocument(); objXML.LoadXml(eventXml); string projectName = (objXML.GetElementsByTagName(\u0026#34;Name\u0026#34;)[0] as XmlElement).InnerText; if (objXML.DocumentElement.Name == \u0026#34;ProjectCreatedEvent\u0026#34;) { string strTFSServer = Properties.Settings.Default.TFSServer; TeamFoundationServer tfs = new TeamFoundationServer(strTFSServer, new NetworkCredential(Properties.Settings.Default.TFSLogin, Properties.Settings.Default.TFSPassword, Properties.Settings.Default.TFSDoman)); tfs.Authenticate(); VersionControlServer service = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); TeamProject teamProject = service.GetTeamProject(projectName); List\u0026lt;PolicyEnvelope\u0026gt; policies = new List\u0026lt;PolicyEnvelope\u0026gt;(); string assembly = Properties.Settings.Default.CheckinPolicyAssembly; foreach (string type in Properties.Settings.Default.CheckinPoliciesToApply.Split(\u0026#39;;\u0026#39;)) { Assembly checkinPolicyAssembly = Assembly.LoadFile(assembly); object o = checkinPolicyAssembly.CreateInstance(type); if (o is IPolicyDefinition) { IPolicyDefinition def = o as IPolicyDefinition; PolicyEnvelope[] checkinPolicies = new PolicyEnvelope[1]; bool foundPolicy = false; foreach (PolicyType policyType in Workstation.Current.InstalledPolicyTypes) { if (policyType.Name == def.Type) { policies.Add(new PolicyEnvelope(def, policyType)); foundPolicy = true; } } if (!foundPolicy) { throw new ApplicationException(String.Format(\u0026#34;The policy {0} is not registered on this machine\u0026#34;, def.Type)); } } else { throw new ApplicationException(String.Format(\u0026#34;Type {0} in assembly {1} does not implement the IPolicyDefinition interface\u0026#34;, type, assembly)); } } if (policies.Count \u0026gt; 0) { teamProject.SetCheckinPolicies(policies.ToArray()); } } } catch (Exception e) { EventLog.WriteEntry(\u0026#34;NewTeamProjectEventService\u0026#34;, e.Message + \u0026#34;n\u0026#34; + e.StackTrace); return new EventResult(false); } return new EventResult(true); } } Now, there are other things that we also need to do manually for all new team projects. For example we must manually add the build service account to the Build Services group for the new team project. You can’t do this via the process template. So I might extend the project to allow for more things to be applied. Could be a candidate for trying out the MEF framework, so it can be a pluggable architecture.\nComments Imported from the original WordPress site. Closed for new replies.\nDennes — 07 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/20/how-to-automatically-enable-checkin-policies-for-new-tfs-team.aspx#556469\nHi,\nWhere can I find Microsoft.TeamFoundation.Server.dll so I can use the class EventResult ?\nThank you !\n\\\nJakob Ehn — 07 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/20/how-to-automatically-enable-checkin-policies-for-new-tfs-team.aspx#556580\n@Dennes: The EventResult class i located in the Microsoft.TeamFoundation class which you can find in C:Program Files (x86)Microsoft Visual Studio XXCommon7IDEReferenceAssembliesv2.0\nSimon Stone — 17 Jan 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/20/how-to-automatically-enable-checkin-policies-for-new-tfs-team.aspx#558366\nI just ran into this article. What I cannot figure out it is how to create a policy that requires input such as the Custom Path Policy. Any ideas?\nThanks\\\n","permalink":"https://blog.ehn.nu/2009/03/how-to-automatically-enable-checkin-policies-for-new-tfs-team-projects/","summary":"\u003cp\u003eWhen creating new team projects in TFS, the project is created from a project template, that basically is a set of XML files. Here you can define all your work item types, queries, reports, portal site and some other things. One of the things that you \u003cstrong\u003ecan’t\u003c/strong\u003e specify here, is what checkin policies that you want to enable for that team project. At our company, we usually create a new team project for every customer so for every new customer we need to manually modify the checkin policies for that project to match our company policy.\u003c/p\u003e","title":"How To: Automatically Enable Checkin Policies for new TFS Team Projects"},{"content":"A very common question from people is how to handle dependencies between projects/applications/team projects in TFS source control. A typical scenario is that you a common library/framework tucked away nicely somewhere in TFS source control, and now you have some applications that, in some way, needs to reference this project.\nMy colleague Terje has written an article on what he calls “Subsystem branching”, in which he talks about different ways to organize your source code in order to solve the above problem. Ther article can be found here: http://geekswithblogs.net/terje/archive/2008/11/02/article-on-subsystem-branching.aspx\nI won’t go through all the different scenarios again, but thought that I’d show how we do it. We normally use Terje’s solution 3 and 3b, namely Binary deployment branching with or without merging. Shortly, this means that we setup a team build for our common library that we start manually when we have checked in changes that need to be replicated to the applications that are dependent on the library. This build (in addition to compiling, testing and versioning) checks in the library outputs (typically *.dll and *.pdb) into a Deploy folder. This folder is branched to all dependent applications. After the checkin, we merge the folder to the application(s) that will be built against the new version of the library.\nAs Terje mentions, another approach to this problem is the TFS Dependency Replicator which is a very nice tool that automates copying the dependencies between different parts of the source control tree. The main objective that we have with that approach is that using copying gives you no traceability. You have no easy way to see which applications use which version of which library.\nIn this post, I thought I would show how to implement this using TFS Team Build. We will implement solution 3b from Terje’s post, which means that efter we check in the binaries from the library build, we will automatically merge those binaries to the dependent projects.\n**\nCustom Task or “plain” ? **I considered implementing a custom task to implement this kind of dependency replication. The problem however, is that once you start wrapping functionality in the TFS source control API, you find that you often end up reimplementing lots of stuff to not make the task to simplistic. There are myriads of options for the tf.exe commands, and different scenarios often require different usage of the commands. So to keep it flexible, I suggest that you use the command line tool tf.exe instead when you are working against TFS source control. On the downside, you need to learn a bit more MSBuild…. :-)\nSample Scenario\nWe have one CommonLibrary project, which just contains a ClassLibrary1 project. In addition, we have the Deploy folder that is used for the resulting binary. Then we have two applications (Application1 and Application2) that each simple contains a WpfApplication project.In addition, each application has a Libs folder that is a branch from the Deploy folder. (The Deploy/Libs names have become a naming convention for us).So, we want a release build for CommonLibrary that builds the ClassLibrary1 assembly and checks it in to the Deploy folder, and then merges it to Application1Libs and Application2Libs.\nWorkspace Mappings\nNow, before starting to go all MSbuild crazy, we need to discuss what the workspace for this build definition should look like. First of all, the workspace for the CommonLibrary build should not include anything from the dependent applications. This means that we must dynamically include the Libs folders into the build workspace as part of the build, to be able to perform the merge. Also,we really don’t want the Deploy folder to be part of the workspace for the build. If it is, the changesets that are created by the build will show up as associated changesets for the build, which is really not relevant since they contain the outputs of the build. So, the workspace mapping for our build definition looks like this: \\\nImplementing the Build The steps that we need to implement in our team build is:\nDecloak the Deploy folder into the current workspace and peform a check out Copy the build output to the Deploy folder and check it back in Add the Libs folders to the current workspace Merge the Deploy folder to the Application1/2Libs and check everything in All these steps uses the Team Foundation Source Control Command-Line tool (tf.exe) to perform operations on TFS source control.\nWe start off by defining some properties and items for the source and destination folders:\n\u0026lt;PropertyGroup\u0026gt; \u0026lt;TF\u0026gt;\u0026#34;$(TeamBuildRefPath)..tf.exe\u0026#34;\u0026lt;/TF\u0026gt; \u0026lt;ReplicateSourceFolder\u0026gt;$(SolutionRoot)Deploy\u0026lt;/ReplicateSourceFolder\u0026gt; \u0026lt;/PropertyGroup\u0026gt; \u0026lt;ItemGroup\u0026gt; \u0026lt;ReplicateDestinationFolder Include=\u0026#34;$(BuildProjectFolderPath)/../../Application1/Libs\u0026#34;\u0026gt; \u0026lt;LocalMapping\u0026gt;$(SolutionRoot)Destination1\u0026lt;/LocalMapping\u0026gt; \u0026lt;/ReplicateDestinationFolder\u0026gt; \u0026lt;ReplicateDestinationFolder Include=\u0026#34;$(BuildProjectFolderPath)/../../Application2/Libs\u0026#34;\u0026gt; \u0026lt;LocalMapping\u0026gt;$(SolutionRoot)Destination2\u0026lt;/LocalMapping\u0026gt; \u0026lt;/ReplicateDestinationFolder\u0026gt; \u0026lt;/ItemGroup\u0026gt; Note the LocalMapping metadata that we define for each ReplicateDestinationFolder item. This will be used later on when modifying the workspace. Step 1:\n\u0026lt;Target Name=\u0026#34;AfterEndToEndIteration\u0026#34;\u0026gt; \u0026lt;!-- Get and checkout deploy folder--\u0026gt; \u0026lt;MakeDir Directories=\u0026#34;$(ReplicateSourceFolder)\u0026#34;/\u0026gt; \u0026lt;Exec Command=\u0026#34;$(TF) workfold /decloak .\u0026#34; WorkingDirectory=\u0026#34;$(ReplicateSourceFolder)\u0026#34; /\u0026gt; \u0026lt;Exec Command=\u0026#34;$(TF) get \u0026#34;$(ReplicateSourceFolder)\u0026#34; /recursive\u0026#34;/\u0026gt; \u0026lt;Exec Command=\u0026#34;$(TF) checkout \u0026#34;$(ReplicateSourceFolder)\u0026#34; /recursive\u0026#34; /\u0026gt; We put the logic in the AfterEndToEndIteration target, which is executed when\nStep 2:\n\u0026lt;!-- Copy build output to deploy folder and check in --\u0026gt; \u0026lt;Copy SourceFiles=\u0026#34;@(CompilationOutputs)\u0026#34; DestinationFolder=\u0026#34;$(ReplicateSourceFolder)\u0026#34;/\u0026gt; \u0026lt;Exec Command=\u0026#34;$(TF) checkin /comment:\u0026#34;Checking in file from build\u0026#34; \u0026#34;$(ReplicateSourceFolder)\u0026#34; /recursive\u0026#34;/\u0026gt; We use the nice CompilationOutputs item group that was added in TFS 2008, which contains all output from every configuration that is built. Note that this won’t give you the *.pdb though. Step 3:\n\u0026lt;!-- Add destination folders to current workspace --\u0026gt; \u0026lt;Exec Command=\u0026#34;$(TF) workfold /workspace:$(WorkspaceName) \u0026#34;%(ReplicateDestinationFolder.Identity)\u0026#34; \u0026#34;%(ReplicateDestinationFolder.LocalMapping)\u0026#34;\u0026#34;/\u0026gt; Here we use MSBuild batching to add a workspace mapping for each destination folder into the current workspace. We pass the %(ReplicationDestinationFolder.Identity) as the source parameter to the merge command, and we send the %(ReplicationDestinationFolder.LocalMapping) as the destination parameter, which we defined previously´ Step 4:\n\u0026lt;!-- Merge to destinations and check in--\u0026gt; \u0026lt;Exec Command=\u0026#34;$(TF) merge \u0026#34;$(ReplicateSourceFolder)\u0026#34; \u0026#34;%(ReplicateDestinationFolder.LocalMapping)\u0026#34; /recursive\u0026#34;/\u0026gt; \u0026lt;Exec Command=\u0026#34;$(TF) checkin /comment:\u0026#34;Checking in merged files from build\u0026#34; @(ReplicateDestinationFolder-\u0026gt;\u0026#39;\u0026#34;%(LocalMapping)\u0026#34;\u0026#39;, \u0026#39; \u0026#39;) /recursive\u0026#34;/\u0026gt; So, every build will result in two checkins, first the check-in of the file(s) to the Deploy folder, and the a check-in for all merged binaries. Note: I haven’t added any error handling. Typically you would add a OnError to the target that performs a tf.exe undo /recursive to undo any checkouts.\nComments Imported from the original WordPress site. Closed for new replies.\nJohannes Urke — 29 Apr 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx#469838\nAwesome post Jakob. We are setting up automatic dependency publishing for a customer using team build, and you pointed out a lot of things we hadn\u0026rsquo;t thought of. (Setting workspace during build, using branch/merge instead of file copy, etc.)\nThank you very much for sharing!\nRyan Feagley — 03 Jun 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx#522513\nGreat Post!! I\u0026rsquo;m very interested in using the 3b strategy. At this point I\u0026rsquo;m using TFS 2010. I\u0026rsquo;m hoping you might be interested in updating this post to incorporate the new WF 4 format in 2010. Thanks for the excellent blogging!!\nChristian Jacob — 05 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx#536476\nI second this! Awesome post. However, as Ryan already asked, could you write an update that shows up how to achieve something like that using Workflow Activities on Team Build 2010?\nSaif — 21 Sep 2010\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx#539271\nExcellent post. Can you please update this for TFS 2010.\nHassan — 06 Apr 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx#572515\nGreat Post, but when can we get some update of this for tfs2010?\nvillecoder — 10 Jun 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx#581512\nFor those of you landing here looking for a solution to TFS 2010, he has one posted. The URL is http://geekswithblogs.net/jakob/archive/2010/12/08/dependency-replication-with-tfs-2010-build.aspx .\n","permalink":"https://blog.ehn.nu/2009/03/implementing-dependency-replication-with-tfs-team-build/","summary":"\u003cp\u003eA very common question from people is how to handle dependencies between projects/applications/team projects in TFS source control. A typical scenario is that you a common library/framework tucked away nicely somewhere in TFS source control, and now you have some applications that, in some way, needs to reference this project.\u003c/p\u003e\n\u003cp\u003eMy colleague \u003ca href=\"http://geekswithblogs.net/terje\"\u003eTerje\u003c/a\u003e has written an article on what he calls “Subsystem branching”, in which he talks about different ways to organize your source code in order to solve the above problem. Ther article can be found here: \u003cbr\u003e\n\u003ca href=\"http://geekswithblogs.net/terje/archive/2008/11/02/article-on-subsystem-branching.aspx\" title=\"http://geekswithblogs.net/terje/archive/2008/11/02/article-on-subsystem-branching.aspx\"\u003ehttp://geekswithblogs.net/terje/archive/2008/11/02/article-on-subsystem-branching.aspx\u003c/a\u003e\u003c/p\u003e","title":"Implementing Dependency Replication with TFS Team Build"},{"content":"The source code for this policy is available here : http://www.codeplex.com/TFSCCCheckinPolicy Checkin policies is a great tool in TFS for keeping your code base clean and adhering to your companhy standards and policies. The checkin policies that are included are very useful, but don’t stop there! Implementing your own custom checkin policy is pretty straight-forward and can soon pay off by stopping people from doing silly things (on purpose or not…).\nAt our company (Osiris Data) we have developed several small checkin policies that both stop people from breaking our standards, but also helping them to do the right thing. We all make mistakes from time to time, and if a tool can help us not doing them, then that’s pretty good… :-)\nFor example we have a checkin policy that stop people from checking in binaries into TFS. Of course there are occasions when people are allowed to do this (3rd party dll:s, binary references), so then we check that the binaries are placed in folders that are named according to our naming policies, thereby enforcing standards across the team projects.\nI recently saw a post in one of the MSDN forums asking for a checkin policy that would check coverage as part of a check-in. That is, if the latest test run either does not have code coverage at all, or the total code coverage percentage is below a certain treshold, the policy would stop the check-in. I couldn’t find any such checkin policy on the net, so I decided that it would be fun to write one.\nThe following things must be solved:\nLocating the latest test run and code coverage information \\ Analyzing the code coverage information The first part was simple to implement, unfortunately there does not seem to be anything in the VS.NET extensibility API that allows you to locate the test runs or code coverage information, so I basically had to run through the folder structure beneath the current solution to locate the folder with the latest test run. Simple and rather boring, so I won’t mention that code here.\nThe second part was a bit worse, since the API for running and analysing code coverage is totally undocumented and, frankly, not supported by MS. However, the following blog post by Joe contained the information I needed in order to load and analyse the code coverage information. As always with unsupported stuff, there is no guarantee that the code will work with new versions of VSTS or even service packs. This code has been tested on VSTS 2008 SP1.\nThe code coverage result is stored in a proprietary binary format, and is located beneath the test run result. the local folder structure looks like this:\nSolution ----- TestResults ---- TestRun1 ----- In ------ data.coverage ------ Out ------ Binaries from the instrumented assemblies To programmatically access and analyse the code coverage results, we need a reference to the Microsoft.VisualStudio.Coverage.Analysis assembly, which is located in the private assemblies folder of VSTS. In this assembly, we use the CoverageInfoManager class to load the coverage file. In addition this class contains a method that returns a typed dataset (method is appropriately called BuildDataSet). This method returns an instance of the CoverageInfo class from which we can easily read the information.\nThe code snippet for loading the coverage file calculating the total code coverage in percent looks like this:\nCoverageInfoManager.ExePath = binariesFolder; CoverageInfoManager.SymPath = binariesFolder; CoverageInfo ci = CoverageInfoManager.CreateInfoFromFile(codeCoverageFile); CoverageDS data = ci.BuildDataSet(null); uint blocksCovered = 0; uint blocksNotCovered = 0; foreach (CoverageDS.ModuleRow m in data.Module) { blocksCovered += m.BlocksCovered; blocksNotCovered += m.BlocksNotCovered; } return GetPercentCoverage(blocksCovered, blocksNotCovered); Note that we must set the ExePath and the SymPath properties to the folder where the instrumented assemblies is located. If not, the BuildDataSet method will throw a CoverageException.\nSo all we have to do then is to implement the PolicyBase.Evaluate method and compare the totalCodeCoverage with the configurable treshold. This treshold is configured by implementing the CanEdit and the Edit methods. See the source code for how this is done, it is all standard checkin policy stuff.\nHopefully this checkin policy will be useful for some people, let me know about any problems and I will try to fix them asap.\nComments Imported from the original WordPress site. Closed for new replies.\nIan Ceicys — 25 Feb 2009\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/02/23/writing-a-code-coverage-checkin-policy.aspx#433640\nI\u0026rsquo;d love to see the source for this checkin policy. Can you please try republishing it to codeplex or sending me the code?\nThx.\nVDeevi — 25 Jul 2011\nOriginally posted on: http://geekswithblogs.net/jakob/archive/2009/02/23/writing-a-code-coverage-checkin-policy.aspx#587340\nHi Ian,\nPlease find the following link for Source code to this blog information\u0026hellip;\nhttp://tfscccheckinpolicy.codeplex.com/SourceControl/list/changesets#\nThx \u0026amp; Rgds,\nVDeevi\n","permalink":"https://blog.ehn.nu/2009/02/writing-a-code-coverage-checkin-policy/","summary":"\u003cp\u003e\u003cstrong\u003eThe source code for this policy is available here :\u003c/strong\u003e \u003ca href=\"http://www.codeplex.com/TFSCCCheckinPolicy\" title=\"http://www.codeplex.com/TFSCCCheckinPolicy\"\u003e\u003cstrong\u003ehttp://www.codeplex.com/TFSCCCheckinPolicy\u003c/strong\u003e\u003c/a\u003e \u003cbr\u003e\nCheckin policies is a great tool in TFS for keeping your code base clean and adhering to your companhy standards and policies.  The checkin policies that are included are very useful, but don’t stop there! Implementing your own custom checkin policy is pretty straight-forward and can soon pay off by stopping people from doing silly things (on purpose or not…).\u003c/p\u003e","title":"Writing a Code Coverage Checkin Policy"}]