How To: Create an offline installer for Visual Studio from a Web Installer


If you have the need to download the complete set of files for a given Visual Studio update so that you can burn them to media or place them on an internal network share for distribution, you can run the Visual Studio 2012 installation bootstrapper with the /layout switch to force it to download all of the update packages and place them on your drive in a folder of your choosing.

 1: "VS2012.2 CTP.exe" /layout

You can now use that installation folder’s contents as the source for your upgrades. Please realize that you will need a couple of GBs of space to save the installation.  The complete download for VS 2012.2 CTP 4 comes in at 1.66GB.



The current VS Updates use a small installation “bootstrapper” that figures out what you have installed (Pro vs. Premium vs. Ultimate) and then does an install-time download of the needed updates. As you can see in Figure 1, the update installer is only 1.3MB in size so it downloads fast and your installation can begin immediately.  You will also notice that there is no option to download the entire update for all Visual Studio versions as a single MSI or ISO file.


Figure 1: Downloads page from Visual Studio 2012 Update 2 CTP 4 ds page – 

When you run this installer you will see that the installation take a while to start.  It will eventually get to the “Install” screen.  There is a “More Information” link that changes the display to show you all of the packages that will be downloaded and installed for your particular installation.  As you can see in Figure 2, updating my Visual Studio 2012 Ultimate installation will cause the installer to download an additional 775MB of data during the install.  If I had Visual Studio Premium the download would be smaller and if I had Visual Studio Pro, it would be even smaller yet. So the architecture of a small bootstrapper that figures out and downloads only the needed updates is a good one to reduce overall bandwidth, especially in bandwidth constrained environments or countries.

But what if you have to do this to multiple machines?  You are now performing the same download over and over again.  The time-to-download tax is being paid by everyone on the team. Another scenarios is that you might be working in a highly-secure environment and your development machine doesn’t have access to the internet. In this case you absolutely have to get the update from an internet-connected machine and then place it somewhere it can be accessed by the secure PCs (or burn it to disk).


Figure 2: The additional downloads needed to update VS 2012 Ultimate Update 1 to VS 2012 Ultimate Update 2 CTP 4



To allow for this scenario, Microsoft has added a command-line switch option to the installation bootstrapper executable. You can use the /layout parameter to force the installer to download all of the update packages to specified folder.


Figure 3: Command-line parameters for VS installs –

When you run the installer with the /layout option, the installer will display a dialog that allows you to select the download location.


Figure 4: Using the /layout option to have the installer prompt for a download location

Clicking the Download button on the installer dialog will start the download.  As you can see in Figure 5, the download pulls all of the packages and stores them in a Packages folder under the folder you specified.  You can also see that it is complete download of all languages.  I am downloading from a machines whose locale is set to en-us but Figure 5 is showing that it is downloading the “Entity Framework Designer for Visual Studio 2012 – JPN”.


Figure 5: Downloading installation packages.

When it finishes you will se the “Setup Complete” message. 

Notice that in Figure 2, Visual Studio was telling me that it needed to download an additional 775MB of installation packages to update my machine.  In Figure 6 you can see that using the /layout option actually cause Visual Studio to download 1.66GB of packages. 


Figure 6: Download complete. Requires 1.66GB for VS 2012.2 CTP 4

So regardless of whether the machine you are using has VS Ultimate, Premium, Pro or nothing at all, the /layout switch will pull down all of the packages that would be shipped as an .ISO or .MSI. That will allow you to do this process once and be able to update any Visual Studio installation across your company, even localized versions.


To create a stand-alone, offline installer for Visual Studio or it’s updates from a Web Installer, you can use the /layout command-line option.  This will download all of the installation packages that Microsoft provides for all versions and languages of Visual Studio. This download can then be burned to disk, copied to USB or copied to a network share for distribution.

Using the bootstrapper alone will significantly save on bandwidth since it will determine your VS version and language so that it only downloads those updated packages that you truly need for your installation.

Technorati Tags: ,,,,,,

TFS 2012 Quick Note: How to add text formatting and line breaks to the DEFAULT text of a work item field

This is a quick note so that I can find this in the future. Smileimage


There are times when you want modify a work item so that the value of an HTML string field, like the Description field on a Requirement, has some default value when a new work item is created. You may also want to put some formatting on some or all of this text.

I was working with a customer that wanted to have a “template” for data security that would help the Business Analysts be more consistent in their requirement documentation. We added some bold template text that would be used as a reminder.  The BA would just add the field name and security requirements in plain text next to the defaulted labels.



To get this effect we set the DEFAULT rule on the underlying HTML field to a string of HTML that will get rendered at runtime.  There are two ways that you can enter the HTML to be rendered, through the Process Template Editor or directly within the work item type definition file.  Please note the caveat at the end of this article so you don’t get burned by a limitation of the work item definition schema.

Using the Process Template Editor

When using the Process Template Editor you need to create a DEFAULT rule for your field. In the FROM field select “value” and in the VALUE field you enter your HTML fragment.  In this editor you can enter your HTML just like you would in Visual Studio.  When you hit OK to close the DEFAULT dialog it will escape all of the special characters in the HTML fragment.


Editing the Work Item Type Definition directly

If you edit the work item type definition directly, you have to escape all of the “special” characters so that they don’t interfere with the raw XML surrounding them.  When uploaded to TFS, the escaped entries will be converted to HTML tags that can be rendered at runtime.

 1: <FIELD name="Security" refname="MyCompany.Security" type="HTML">
 2:  <DEFAULT from="value" value="Field Name: 

Field Name: 
Security: "
 3: FIELD>


There is one thing that really limits the usefulness of this technique.  There is a limit of 255 characters in the value attribute of the DEFAULT element.  This limit is imposed when you import the work item type definition into the team project, so you have to be aware of this when using the Process Template Editor as the text entered there will be escaped on save and could easily go over the character limit.

Community TFS Report Extensions open-source reports hits v1.0 milestone

Microsoft ALM MVP Tommy Norman and I have been working on creating a set of reports that fill some of the gaps in the TFS 2010 out-of-box process templates.  The output of this effort is the Community TFS Report Extensions project on Codeplex which was started this past summer but has finally become stable enough to reach the v1.0.0 milestone.

Tommy has crafted a nice write-up on his blog, so please pop over there and take a look then head on over to the project and check out the first two reports.



Figure 1 – Test Plan Status report



Figure 2 – Release Plan report

VS 2012 – Coded UI Tests (CUIT) Now Automatically Closes Browser or App Upon Test Completion



  • Microsoft changed the behavior of Coded UI Tests between Visual Studio 2010 and Visual Studio 2012.
  • The change is that the browser window or app window being used for the test case will automatically be closed after each test case unless you add code to keep it open.
  • In any event, the browser window or app window used will always be closed at the end of a test run.
  • During development you can use a Breakpoint to halt test execution prior to the windows being closed.


There is a behavior change between Coded UI Tests (CUIT) running in Visual Studio 2010 and Visual Studio 2012 .  In Visual Studio 2010, a test case would leave windows open on the desktop unless they were explicitly closed in code in the test class.  In Visual Studio 2012 , the window of the application under test (browser, WPF app, etc.) is automatically closed whether or not it was closed in code during the test run.  If you are new to CUIT and you only use VS 2012 then you weren’t aware that the behavior changed.  If you have upgraded from VS 2010 then this is something new.

Why did the folks at Microsoft make this change?

This change was added to make it easier to create an maintain test cases because it saves you from explicitly having to close your app window or browser at the end of every test. An automated test run that has many test cases launching browser windows but never closing them will leave the test client’s desktop in a messy state.  I agree that it makes CUIT easier.

So why write a blog post about something you agree with?

The reason for this post is that it changes the way that folks from VS 2010 interact with coded UI tests, specifically if you use a manual test’s Action Recording as the starting point for your CUIT.
In VS 2010 I would create a new CUIT and use the action script from a manual test case to generate a base test without any validation as in the code below. I’d then run this test to make sure everything worked as expected.  At the end the browser would close.

public void KioskSmokeTest()

Figure 1: Basic coded UI test that explicitly closes the app under test

Now I need to add some validation to my test.  Normally I would just comment out the line that closes the windows, in my example this.UIMap.CloseKiosk() and re-run the test.  This would leave the app window open and the app would be in the correct state for me to add validations.

public void KioskSmokeTest()

Figure 2: Basic coded UI test that is supposed to leave the app window open at the end

My example is fairly simple, but what if the ExerciseUI() method actually navigated through 4 or 5 screens and added test data. In this case, my process has allowed the test to perform all of the data entry and I am assured that the app is in the correct state for my validations.  This saved me a lot of work and headaches.

In VS 2012, this behavior isn’t the same.  The CloseKiosk() method is no longer needed as the test engine will automatically close the app between test cases unless told to keep them open.  In effect, the first code example is now equivalent to the second one.


But I liked the old behavior, is there a workaround?

Your only option is to set a breakpoint on the last executable line within your test case and then go to Test View and right-click on the test’s name then select Debug Selected Tests.  When the breakpoint gets hit, press F10 to let the last executable line run then just stop debugging.  That will leave your app in the correct state and you can now use the Coded UI Test Builder to create your Assertions.



Figure 3: Use a breakpoint and debug your test to get to the right app state for validation



Figure 4: Stop debugging when you have finished execution of all of the preparatory steps


What if I chain test cases together and assume that the app stays open between tests?

Some folks write completely self-contained tests like my KioskSmokeTest above.  Other folks have more complex needs and write tests that get run in a specific order, each collaborating to setup the state of a system and then performing validations. This can be called “chaining tests”.

If you have chained tests, the new behavior will break your test runs since the application under test gets closed after each test case is run.  Microsoft has added some new flags that can be set (depending on app platform) to tell the test engine to leave your app alone between tests cases in a single test run.

If your target app is browser-based, you can tell the testing framework to leave the browser open at the end of the test case by setting the BrowserWindow.CloseOnPlaybackCleanup property to false (Line 5 below).


public VerifyValidDefaultSearchTest()
 //Leave the browser open
 .CloseOnPlaybackCleanup = false;

 .UIDinnerNownetWindowsIWindowUrl = 

Figure 5: Use CloseOnPlaybackCleanup to keep the browser open

The Microsoft Visual Studio ALM team has a nice blog post describing this in more detail.

If your target app is not browser-based (WPF/WinForms/etc.) then you need to use the ApplicationUnderTest.CloseOnPlaybackCleanup() property.
Note: There is a bug in VS 2012 RTM that causes ApplicationUnderTest.CloseOnPlaybackCleanup() property to be ignored.  This bug is fixed in VS 2012 Update 1.
Unfortunately the ApplicationUnderTest object isn’t as easy to access as the BrowserWindow objects.  To make this work you will have to capture the instantiation of your app in the UIMap.Designer.cs file and store the reference in a variable that can be seen from your test methods.

Below you see the code that was generated in the UIMap for my application.  This code launches the DinnerNowKiosk application and uses a local variable to store the handle to the app.  Once the StartDinnerNowKiosk method goes out of scope, the reference is no longer accessible.  Also, you can’t just go and add a call to dinnerNowKioskApplication.CloseOnPlaybackCleanup = false because this is a generated code file so the added code will be lost of the UIMap is regenerated.


public void StartDinnerNowKiosk()
 ApplicationUnderTest dinnerNowKioskApplication = 


Figure 6: The generated application launch code in the UIMap.designer.cs file

Instead you have to use the UIMap.cs partial class to add your new startup code.  Just copy the StartDinnerNowKiosk() method into the partial class and set the CloseOnPlaybackCleanup property to false.


public partial class UIMap
 static ApplicationUnderTest dinnerNowKioskApplication_persistent = null;

 public void StartDinnerNowKiosk_Persistent()
 if (null == dinnerNowKioskApplication_persistent)
 dinnerNowKioskApplication_persistent = ApplicationUnderTest.Launch 
 dinnerNowKioskApplication_persistent.CloseOnPlaybackCleanup = false;


Figure 7: The new app launch code from the non-generated partial class in the UIMap

And then change your test to call the new app launcher method.


public class KioskSmoke

 public void KioskSmokeTest()

 public void KioskSmokeTest2()


Figure 8: The updated tests that call to the new app launcher.

In the example above, the StartDinnerNow_Persistent() method is called from each test case because we don’t know the order these test will be run. If you need to have the tests run in a specific order then you need to create an additional test method that calls them in the order desired.


Can I keep the app under test open between test runs?

No.  The app/browser is launched by the test agent process (QTAgent).  At the end of a test run QTAgent is shut down, so any child processes are also shut down. I have confirmed this behavior in VS 2012 RTM and VS 2012 Update 1.



MSDN: BrowserWindow class –

MSDN: ApplicationUnderTest class –



Visual Studio 2012 Update 1 Download –

Visual Studio 2012 ALM Blog: Coded UI Test: Why does application close after each test in Visual Studio 2012? –

Team Foundation Service is open to the public (and free!)

SNAGHTML80a046dThe Visual Studio Team has hit another major milestone in the evolution of Team Foundation Server.  Back at the BUILD conference last year they announce a hosted TFS offering called Team Foundation Service.  This hosted solution brings TFS based Work Item Tracking, Version Control and Automated Build through a browser and is connectable from Visual Studio just like an on-premises deployment of Team Foundation Server.  Use of the service was limited to those few that were able to get their hands on an Invitation Code.  This was done primarily to allow for a slow ramp-up in users of the service to help find and remedy scalability problems.

“Since we announced the Team Foundation Service Preview at the BUILD conference last year, we’ve limited the onboarding of new customers by requiring invitation codes to create accounts.  The main reason for this has been to control the growth of the service to make sure it didn’t run away from us and end up with a bad user experience.  In this time period, we’ve continued to work on our infrastructure, performance, scale, monitoring, management and, of course, some cool new features like cloud build. ”   – Brian Harry

Today, Brian Harry announced that there is no longer the need for an Invitation Code.  The Service is now open to the Public.  This means that they are confident in the service’s ability to handle the load as well as their ability to monitor activity and upgrade the service with little disruption to the global user community.

They are still offering the service without charge and while they get the final pieces in place to offer a complete commercial service.

“The service will remain in “preview” for a while longer while we work through additional features like data portability, commercial terms, etc but the terms of service support production use, the service is reliable and we expect to carry all of your data forward into production. ”  – Brian Harry

Brian has an excellent walk-through on how to get access to the service and begin playing with the service, the cloud-hosted build servers and the new Azure continuous deployment features.

Brian’s complete post can be found at