Skip to main content

Team Foundation Server 2010: Build - Deploy - Test (Part 1)

Visual Studio - Lab Management (An Introduction)


  • Visual Studio Lab Management is an extension of Microsoft Test Manager that helps you to optimize the use of Microsoft Hyper-V technology to manage and use virtual machines in testing, building, and developing applications in Visual Studio 2010.  
  • Visual Studio Lab Management is integrated with System Centre Virtual Machine Manager (SCVMM) to enable managing multiple physical computers that host virtual machines and to manage the storage of virtual machines, virtual machine templates, and other configuration files in SCVMM library servers.


  • Visual Studio Lab Management can enable developers & testers can easily create virtual environments
    • Provides the ability to create an environment by using Microsoft Test Manager and assign virtual machines to each role that is required for the application that you intend to develop, test, or run. For example, you might be developing a multi-tiered application that requires three roles:
      • Desktop client
      • Web server
      • Database server
    • By using Lab Management, you can:
      • Create a virtual environment that assigns a virtual machine to each role
      • Deploys each part of the application to the relevant virtual machine by using Team Foundation Build
      • Runs the three virtual machines as a single instance of the application for testing.
    • A virtual environment can also be setup where only some components of the application are deployed whereas other components are shared across environments. For example, if your application needs a large database, you can decide to host a shared database on a physical machine. All virtual environments will have only virtual machines for the client and application tiers that can connect to the shared database as required.
  • Enables the automation build-deploy-test cycle
    • The Visual Studio Lab Management’s Workflow (build-deploy-test) is as follows:
      • When the build is complete, restore the virtual environment to a clean snap shot
      •  Deploy the build to the environment and take a snapshot when the build is deployed (*this snapshot is optional)
      • Run automated tests that validate the build quality
  • It lets you test the build quality early and often with little effort
    • Reproduce the exact conditions of a bug or other development issue:
      • Lab Management snapshots capture the state of all computers in the environment at a point in time.
      • A snapshot of environment can be shared with members of a project team.
      • A reference to the stored snapshot can be included in Visual Studio Team Foundation Server work item so that a copy of the environment can be created with a few clicks of the mouse.
      • When Microsoft IntelliTrace data is included in the work item, the execution path of the application to the bug can be fully reproduced on the exact configuration where the bug occurred.
    • Build, deploy, and test applications automatically in a clean environment:
      • Using Lab Management workflows for Visual Studio Team Foundation Server builds, environments, snapshots and Microsoft Test Manager automated tests, you can stage daily builds of your application to a clean environment.
      • After tests have been run, you can store the environment in a snapshot and then restore the environment to its original state so that it can be used again.
    • Reduce the time required to create and configure machines for testing an application:
      • Using Lab Management stored virtual machines and templates, you can quickly deploy customized environments that recreate the configuration of customer's production environments.
    • Run multiple copies of a test or development at the same time
      • Using Lab Management stored virtual environments, you can deploy multiple copies of a virtual environment at the same time without the computer name conflicts that can limit the use of unmanaged virtual machines in a domain.
    • Enable members of a team to create and manage virtual environments without requiring system administrator privileges:
      • You can use Lab Management permissions to create role-based self- service groups of team members who can deploy, create and manage virtual environments without requiring system administrator privileges.
      • You can also combine Lab Management permissions with Visual Studio Team Foundation Server and SCVMM permissions to meet the specific requirements of your organization.


Popular posts from this blog

Internet Information Services(IIS) reveals its real or internal IP Address

In the ever changing world of global data communications, inexpensive Internet connections, and fast-paced software development, security is becoming more and more of an issue. Security is now a basic requirement because global computing is inherently insecure.

Keeping that in mind, we recently ran our flagship product through a security audit. It was such a helpful exercise in tying-off any remaining lose ends in our application in terms of application security. 
Based on the security audit report, there was a relatively minor issue that appeared when accessing the /images directory of our application. Turns out that the Location response header of the 301 request returns an Internal IP address. The issue is detailed below.

Issue reportedInternet Information Services (IIS) may reveal its real or internal IP address in the Location header via a request to the /images directory. The value returned whilst pen testing is

The riskInformation regarding internal IP add…

C# Console app that displays twitter feed using Linq To Twitter (using Single User Authorization)

I recently had to add a twitter feed to my existing ASP.NET MVC 4 application. All I had to do was pull the last 10 tweets for a given user. It took me a while (shamefully, 3 hours) to get it working so I thought of writing a simple tutorial that explains how to pull a twitter feed for a console app using LINQ to Twitter.

LINQ to Twitter is an open source 3rd party LINQ Provider for the Twitter micro-blogging service. It uses standard LINQ syntax for queries and includes method calls for changes via the Twitter API
What took me long to figure out was the way twitter has implemented authentication using OAuth. Before you do anything, make sure you read the Learning to use OAuth document.
In my example, I used Single User Authorization. Single User Authorization is designed for scenarios where you'll only ever have one account accessing Twitter. i.e. if your Web site does periodic Twitter updates, regardless of user or you have a server that monitors general information. 
Before we be…

Unit Testing HttpContext.Current.Session in MVC3 .NET

We recently changed some functionality where during the "CREATE" process, we go through a wizard to save application data. This data is saved only to the session in the final step when the user clicks the final submit.

This was easy enough to implement but when I started writing unit tests for my static methods that Add, Update, Delete or Modify the contents of our application data in the session, I got the following error:
System.NullReferenceException: Object reference not set to an instance of an object.

Turns out I had forgotten to setup the HttpContext.
The following "TestInitialise" method fixed my problem :)

public void TestSetup()
// We need to setup the Current HTTP Context as follows:

// Step 1: Setup the HTTP Request
var httpRequest = new HttpRequest("", "http://localhost/", "");

// Step 2: Setup the HTTP Response
var httpResponce = new HttpResponse(new StringWriter());

// Step 3: Se…