Updating the Microsoft TFS 2012 and Project Server 2013 VM to TFS 2013

I’ve recently had to perform an update to my copy of the Microsoft-provided Team Foundation Server 2012 and Project Server 2013 virtual machine

The virtual machine is running TFS 2012.1, SQL Server 2008 R2 Enterprise and Project Server 2013. Also, SQL Server Reporting Services was not needed for the demos performed on this VM, so it was never configured. Unfortunately, the upgrade can’t complete successfully if SSRS isn’t working. Given this configuration, there are a few prerequisites steps needed.

Login

First off, login to the VM using the Administrator account (password: P2ssw0rd)

Configure SSRS

  • This is as easy as running the Reporting Services Configuration Manager program and starting the service.

SNAGHTML42f557

  • Now go to the Web Service URL tab and click the Apply button to configure the web service.

image

  • We need to do the same thing on the Report Manager URL page. Click the Apply button here too.

image

  • We need to setup the database on the Database tab.  Click the Change Database button. In the Report Server Database Configuration Wizard, select Create a new report server database then click Next.

image

  • We are going to keep all of the defaults in this wizard, so just keep clicking Next, Next, Next. You will finally get configured, so click Finish to close the wizard.

image

  • The Database tab should now show the configured database and credentials.

SNAGHTML55f91e

Update SQL Server

TFS 2013 does not support SQL Server 2008 R2 so we need to upgrade the database in-place.  To do this, just grab your copy of SQL Server 2012 Enterprise with Service Pack 1 and run an Upgrade.

Note: Make sure you use the Enterprise version of SQL Server 2012 since the existing installation is Enterprise.

Upgrade TFS 2012.1 to TFS 2012.3

TFS 2012 Update 1 was a bit buggy, so I always recommend that folks go to the latest Quarterly Update before jumping major versions. This step will get the TFS databases upgrade and stable before we install TFS 2013.

As of this writing, TFS 2012 Update 3 is the latest releases version.  Just grab the Update and run it on your server. Nothing special here.

Note: You are going to need the ISO (1.1gb) for this step and the next, so download that file instead of the Web installer (743kb).

Update the Project Server Extensions  to TFS 2012.3

Install the Project Server Extensions for TFS 2012.3 from the ISO you downloaded for the last step.

c16f004

Uninstall TFS 2012.3 Project Server Extensions

Yes, I know we just installed these, but that was to make sure the databases were all set.  With that done, we need to get these bits off the server so we can put down the 2013 bits.

Go to Add/Remove Programs and uninstall the Project Server Extensions.

Uninstall TFS 2012.3

Again, we need to clear out the old bits to make room for the new bits.  In Add/Remove Programs uninstall Microsoft Team Foundation Server 2012.

Install TFS 2013

Now we are ready to install TFS 2013.  This is a simple install.  When the installer is done, run the Upgrade Wizard to upgrade your databases.  Remember, the password is always P2ssw0rd.

Install the Project Server Extensions for TFS 2013

Just like in the 2012 case, these bits are on the TFS 2013 ISO disk in the Project Server Extensions folder.  Just run it and take the defaults.

That’s it!

You should now have a fully functional TFS 2013 with Project Server 2013 virtual machine to play with. Enjoy!

TFS 2012 – My warehouse jobs are supposed to be running but show QueuedScheduled

trucks

I just finished a very stressful couple of days.  I was working with a client to upgrade their TFS 2010 installation to TFS 2012.3.  During the process we had a couple of issues to resolve, but one of them was blog-worthy.

The stress came from the fact that if we couldn’t resolve these issues we would have to rollback the entire upgrade to TFS 2010. That would negate two weeks of work and probably have an very unhappy client.

Problem

After getting the customer’s system upgraded we noted that their warehouse wasn’t processing.  Strangely, when we launched the Warehouse Controller Web Service on the App Tier machine we saw that there were lots of jobs that had CurrentRun entries that showed a JobState of QueuedScheduled.

Notice that the Build Warehouse Sync job on Line 26 & 27 is showing a JobProcessingStatus of Idle, but the job’s CurrentRun element on lines 40&41 are showing that the job is running but in a QueuedScheduled JobState.  This makes entirely no sense.  The Job is running but it queued so it’s Idle?

 1: xml version="1.0" encoding="utf-8" ?>
 2: <WarehouseProcessingStatus 
 3:  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 4:  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 5:  xmlns="http://schemas.microsoft.com/TeamFoundatio...">
 6:  <RequestTimeUtc>2013-08-16T14:01:26.4000423ZRequestTimeUtc>
 7:  <WarehouseProcessingOnlineStatus>StartedWarehouseProcessingOnlineStatus>
 8:  <AnalysisProcessingOnlineStatus>StartedAnalysisProcessingOnlineStatus>
 9:  <JobProcessingStatus>IdleJobProcessingStatus>
 10:  <JobsRunning>0JobsRunning>
 11:  <JobsQueued>6JobsQueued>
 12:  <Instance Name="TEAM FOUNDATION"
 13:  JobProcessingStatus="Idle"
 14:  JobsRunning="0"
 15:  JobsQueued="1">
 16:  <Jobs>
 17:  ...
 18:  Jobs>
 19:  Instance>
 20:  <Collections>
 21:  <Collection Name="DefaultCollection"
 22:  JobProcessingStatus="Idle"
 23:  JobsRunning="0"
 24:  JobsQueued="5">
 25:  <Jobs>
 26:  <Job Name="Build Warehouse Sync" 
 27:  JobProcessingStatus="Idle">
 28:  <LastRun QueueTimeUtc="2013-08-16T01:52:33.423Z"
 29:  ExecutionStartTimeUtc="2013-08-16T02:15:11.017Z"
 30:  EndTimeUtc="2013-08-16T02:15:12.123Z"
 31:  Result="Blocked">
 32:  <ResultMessage>
 33:  [Build Warehouse Sync]: ---> TF221107: Reporting for
 34:  Team Foundation Server cannot execute job Build Warehouse Sync
 35:  for team project collection DefaultCollection because the 
 36:  warehouse is offline. Use the Team Foundation Administration 
 37:  Console to start reporting.
 38:  ResultMessage>
 39:  LastRun>
 40:  <CurrentRun QueueTimeUtc="2013-08-16T13:55:00.45Z" 
 41:  JobState="QueuedScheduled" />
 42:  Job>
 43:  
 44:  ...
 45:  
 46:  <Job Name="Work Item Tracking Warehouse Sync" 
 47:  JobProcessingStatus="Idle">
 48:  <LastRun QueueTimeUtc="2013-08-16T01:52:33.423Z" 
 49:  ExecutionStartTimeUtc="2013-08-16T02:15:11.017Z" 
 50:  EndTimeUtc="2013-08-16T02:15:12.123Z" 
 51:  Result="Blocked">
 52:  <ResultMessage>
 53:  [Work Item Tracking Warehouse Sync]: ---> TF221107: Reporting 
 54:  for Team Foundation Server cannot execute job
 55:  Work Item Tracking Warehouse Sync for team project collection
 56:  DefaultCollection because the warehouse is offline. Use the
 57:  Team Foundation Administration Console to start reporting.
 58:  ResultMessage>
 59:  LastRun>
 60:  <CurrentRun QueueTimeUtc="2013-08-16T13:55:00.45Z" 
 61:  JobState="QueuedScheduled" />
 62:  Job>
 63:  Jobs>
 64:  Collection>
 65:  Collections>
 66: WarehouseProcessingStatus>

Digging a little deeper, we jumped down to the Event Viewer on the App Tier machine. 

In case you are not aware, TFS has it’s own section to collect debugging records. These can be found in the Event Viewer | Applications and Services Logs | Microsoft Team Foundation Server | Debug.

SNAGHTMLfdb988a

One of the Information Debug Logs was showing the following error:

 

 1: Log Name: Microsoft-Team Foundation Server/Debug
 2: Source: Microsoft-Team Foundation Server
 3: Date: 8/16/2013 10:09:10 AM
 4: Event ID: 0
 5: Task Category: This task has debugging events
 6: Level: Error
 7: Keywords: Info Messages
 8: User: DOMAINTFSSERVICE
 9: Computer: TFS.company.local
 10: Description:
 11: TFS Informational message
 12: Event Xml:
 13: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
 14:  <System>
 15:  <Provider Name="Microsoft-Team Foundation Server" 
 16:  Guid="{81761665-68A4-47D5-8106-F2ED2AA8687B}" />
 17:  <EventID>0EventID>
 18:  <Version>0Version>
 19:  <Level>2Level>
 20:  <Task>1Task>
 21:  <Opcode>10Opcode>
 22:  <Keywords>0x8000000000000001Keywords>
 23:  <TimeCreated SystemTime="2013-08-16T14:09:10.375773800Z" />
 24:  <EventRecordID>13163EventRecordID>
 25:  <Correlation ActivityID="{018C9C58-F800-0003-99AD-5341209ACE01}" />
 26:  <Execution ProcessID="1472" ThreadID="4720" />
 27:  <Channel>Microsoft-Team Foundation Server/DebugChannel>
 28:  <Computer>TFS.company.localComputer>
 29:  <Security UserID="S-1-5-21-827956790-191126496-1124750213-8536" />
 30:  System>
 31:  <UserData>
 32:  <Info TraceId="{00000001-0001-0001-0000-000000000000} " 
 33:  xmlns="http://schemas.microsoft.com/TeamFoundation/2010/Framework">
 34:  <Tracepoint>1600Tracepoint>
 35:  <ServiceHost>{00000000-0000-0000-0000-000000000000}ServiceHost>
 36:  <ContextId>0ContextId>
 37:  <ProcessName>TFSJobAgentProcessName>
 38:  <Username>
 39:  Username>
 40:  <Service>
 41:  Service>
 42:  <Method>
 43:  Method>
 44:  <Area>JobAgentArea>
 45:  <Layer>JobServiceUtilLayer>
 46:  <UserAgent>
 47:  UserAgent>
 48:  <Uri>
 49:  Uri>
 50:  <Path>
 51:  Path>
 52:  <UserDefined>
 53:  UserDefined>
 54:  <Message>
 55:  Attempt #155: System.ArgumentException: An item with the same key 
 56:  has already been added.
 57:  at System.Collections.Generic.Dictionary`2.Insert(TKey key, 
 58:  TValue value, 
 59:  Boolean add)
 60:  at Microsoft.TeamFoundation.Framework.Server
 61:  .TeamFoundationExtensionUtility.LoadExtensionTypeMap[T]
 62:  (String pluginDirectory)
 63:  at Microsoft.TeamFoundation.Framework.Server.JobApplication
 64:  .SetupInternal()
 65:  at Microsoft.TeamFoundation.Framework.Server.JobServiceUtil
 66:  .RetryOperationsUntilSuccessful(RetryOperations operations, 
 67:  Int32 maxTries, 
 68:  Int32& delayOnExceptionSeconds)
 69:  Message>
 70:  Info>
 71:  UserData>
 72: Event>

Notice on lines 37 & 55 – 56 we have the really important info.  The error is thrown by the TFSJobAgent and the problem is that it is trying to load an item with the same key into a Dictionary.

Solution

A quick online search turned up a blog post by Rory Street aptly entitled “TFSJobAgent Error – An item with the same key has already been added” in which he comments that the cause was that he had multiple copies of a custom warehouse adapter in the TFSJobAgent’s PlugIns folder. 

C:Program FilesMicrosoft Team Foundation Server 11.0Application TierTFSJobAgentplugins

When the TFSJobAgent service starts it recursively scans the Plugins folder looking for warehouse adapters (Microsoft’s or custom).  It uses reflection to find all of the assemblies that implement the ITeamFoundationJobExtension interface.  Since I have two copies of the same adapter (with different file names) in the folder, it tries to load them both and the names collide.  Rory had a slightly different configuration. He had copies of his custom warehouse adapter in a subfolder of PlugIns but the effect is the same sine the search is recursive

To clean up the multiple copies of my custom adapter in the PlugIns folder I needed to:

  • Start an elevated command prompt
  • Run: net stop TfsJobAgent
  • Delete the extra custom warehouse adapter DLLs from the Plugins folder (and its children)
  • Run: net start TFSJobAgent

Once that was done I rechecked the Warehouse Controller Web Service and all of my QueuedScheduled jobs were either Running or completed successfully.

Thanks Rory! 🙂

How To: Reset a Microsoft Surface RT back to Windows 8.0 after installing Windows 8.1 Preview

This post is an elaboration on the Microsoft Support Article Remove Windows 8.1 Preview from Surface.  I felt that this post was needed because of some confusing, missing and incorrect entries in the Microsoft article.

Like many folks, I decided to update my Surface RT to Windows 8.1 Preview the day it came out. The Surface is a new animal, so I wanted the ability to roll back to Windows 8.0 if it became necessary. To be honest, I generally run all Beta and RC versions of Microsoft Operating Systems on my day-to-day devices (laptop, tablet and Windows Phone) and put up with the hiccups so I didn’t expect to need to rollback.   

The Preview documentation says that you can RECOVER your device (wipe it back to 8.0 losing all data) if you create a Recovery USB Drive. I followed these direction to create my USB drive. 

Really, Really Important Stuff

NOTE: If you don’t have a Recovery USB drive prior to upgrading to Windows 8.1 Preview, you cannot reset back to Windows 8.0.  The Surface on-device recovery partition gets updated to Windows 8.1 Preview along with the main partition. Only the USB drive lets you go back.

NOTE 2: If you didn’t create a Recovery USB drive for your Surface you may still be able to get one after the fact.  You will need to create a Recovery drive on a friend, family member or co-worker’s device. Since the Recovery is a “wipe and reset” then any recovery drive should work.  Disclaimer: I haven’t had to do this, but I believe that it will work. Please take this into account if you decide to go this route.  The worst case scenario is that you brick your Surface. You have been warned.

NOTE 3: If you have upgraded your Surface RT device to Windows 8.1 Preview, you will be able to roll-forward to Windows 8.1 Release Candidate or full release when it becomes available. This action will preserve all of your settings and apps, it is non-destructive.

Why I Rolled-back

I had problems with some of the apps that I use regularly so I decided to wipe my device back to Windows 8.0.

Some of my problems included:

  • Scrolling in Rowi’s tweet list stuttered
  • I had 6 Windows Store Updates that would fail to install. when I marked them to be skipped they reappeared as updates when I rebooted.
  • The Kindle app would no longer keep track of the farthest page read , but would return to page 1 when opening a book.
  • The Mail app would randomly stop connecting to my Office365 email account after adding the account to Outlook RT.

With that said, I will probably reinstall the 8.1 Preview once I hear that the scrolling issues are fixed. I can deal with the rest or work around them fairly easily.

What I Did

I performed searches all over Google, Bing and the Microsoft Support Forums looking for the steps to reset my Surface. I was unsuccessful until this evening when I came across a Microsoft Support Article (linked at top).

As I was going through the steps I noticed some discrepancies, so I figured I’d document my steps in case anyone else comes across this.  I’m copying in the steps from the Microsoft article and adding my own comments as sub-bullet points.

Reset Surface from a USB recovery drive

  1. Open the Settings charm, tap or click Power, and then tap or click Shut down. (Or, tap or click the Power icon in the lower-right corner of the sign-in screen.)
  2. Attach the USB recovery drive to Surface.
  3. Hold the volume-down (-) rocker.
  4. Press and release the power button.
  5. When the Surface logo appears, release the volume rocker.
  6. Choose your language options.
  7. Choose your keyboard layout.
  8. From the BitLocker screen, tap or click Skip This Drive.
    • The keyboard might appear so tap the non-text area of the screen to dismiss it so you can see the Skip This Drive link.
  9. Tap or click Troubleshoot.
  10. Tap or click Reset your PC.
  11. Tap or click Next.
    • This is actually a button that says “Windows 8.1 Preview”. This kinda threw me. Select this button, it will give you Windows 8.0. You will have to wait a bit for the next screen to appear.
  12. Surface Pro only: Tap or click No, keep the existing partitions.
    • I saw this on my Surface RT. I selected “No” like this says.
  13. Tap or click Just remove my files.
  14. When Surface displays All ready to go, tap or click Reset.
    • This message never displayed. After Step 13, it went ahead and started the restore.

Surface will reset back to factory settings.

 

If this is helpful, if I’ve messed any steps up or if you see something different, please leave a comment below.

Thanks

Using the Nugetter CodePlex project with TFS 2012 build throws TF215097 error

Problem

While working with a client recently I came across an issue that I think needs to be better documented.

We were implementing Nuget packaging in their TFS 2012 build process.  I knew from past engagements that the Nugetter project on CodePlex is an excellent way to easily add this activity to an existing build process.

We created the build definition using the NuGetterMultiPkgBuildVersionedTemplate20.xaml build process template. When we ran the build, it failed with the following error

TF215097: An error occurred while initializing a build for build definition
[Build Definition] nuget:
Exception Message: The invocation of the constructor on type
‘TfsBuild.NuGetter.Activities.NuGetterProcess’ that matches the specified
binding constraints threw an exception. (type XamlObjectWriterException)

Exception Stack Trace:
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(XamlType xamlType,
Object[] args)
at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(
ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter,
Boolean closeWriter)
at System.Activities.XamlIntegration.FuncFactory`1.Evaluate()
at System.Activities.DynamicActivity.OnInternalCacheMetadata(
Boolean createEmptyBindings)
at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings,
IList`1& validationErrors)
at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity,
ChildActivity& nextActivity, Stack`1& activitiesRemaining,
ActivityCallStack parentChain, IList`1& validationErrors,
ProcessActivityTreeOptions options, ProcessActivityCallback callback)
at System.Activities.ActivityUtilities.ProcessActivityTreeCore(
ChildActivity currentActivity, ActivityCallStack parentChain,
ProcessActivityTreeOptions options, ProcessActivityCallback callback,
IList`1& validationErrors)
at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity,
LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options,
ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.Validation.ActivityValidationServices
.InternalActivityValidationServices.InternalValidate()
at Microsoft.TeamFoundation.Build.Workflow.WorkflowHelpers.ValidateWorkflow(
Activity activity, ValidationSettings validationSettings)
at Microsoft.TeamFoundation.Build.Hosting.BuildProcessCache.LoadFromXaml(
String workflowXaml, TextExpressionImports textExpressionImports)
at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager
.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build,
WorkflowRequest request, IDictionary`2 dataContext)
at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(
WorkflowRequest request, WorkflowManagerActivity activity,
BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)

Inner Exception Details:

Exception Message: Exception has been thrown by the target of an invocation.
(type TargetInvocationException)

Exception Stack Trace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object[] parameters, CultureInfo culture)
at System.Activities.XamlIntegration.ActivityXamlServices.GetXamlSchemaContext(
Assembly assembly, String helperClassName)
at System.Activities.XamlIntegration.ActivityXamlServices.InitializeComponent(
Type componentType, Object componentInstance)
at TfsBuild.NuGetter.Activities.NuGetterProcess.BeforeInitializeComponent(
Boolean& isInitialized)
at TfsBuild.NuGetter.Activities.NuGetterProcess.InitializeComponent()

Inner Exception Details:

Exception Message: Could not load file or assembly ‘System.Management.Automation,
PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.
The system cannot find the file specified. (type FileNotFoundException)

Exception Stack Trace:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,
String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound,
Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,
Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark,
IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection,
Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at XamlStaticHelperNamespace._XamlStaticHelper.Load(String assemblyNameVal)
at XamlStaticHelperNamespace._XamlStaticHelper.LoadAssemblies()
at XamlStaticHelperNamespace._XamlStaticHelper.get_SchemaContext()

I’ve pasted the entire error message here so that it will be indexed by search engines and thus easier to find. 🙂

Solution

We did a little bit of searching online and followed a few dead-end trails.  We finally tracked down a discussion article on the Nugetter project’s discussion page that pointed to a mismatched PowerShell version on the build controller.

While our build controller machine was running Windows Server 2008 R2, we found that it only had PowerShell v1.0 installed.  We need to have PowerShell v3 installed for this to work.

We installed PowerShell v3 on the build controller and build agent and rebooted both machines.  When we triggered the build again it ran to completion.

I’m not sure if the updated PowerShell was necessary for the Build Agent machine but the client decided to install it anyway.

Synopsis

If you encounter this error, make sure the Build Controller box has PowerShell v3 installed on it.

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

Synopsis

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.


 tl;dr

Problem

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.

SNAGHTML3ca3dd

Figure 1: Downloads page from Visual Studio 2012 Update 2 CTP 4 ds page – http://www.microsoft.com/en-us/download/details.aspx?id=36833 

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).

SNAGHTML4fe466

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

 

Solution

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.

SNAGHTML664b92

Figure 3: Command-line parameters for VS installs – http://msdn.microsoft.com/en-us/library/e2h7fzkw.aspx

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

SNAGHTML6b9290

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”.

SNAGHTML709b95[4]

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. 

SNAGHTML82906e

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.

Summary

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: ,,,,,,