April 2006 - Posts

Accessing Team System via the Internet


If you want to provide remote access to Team System over the internet, you may be in for a surprise:

Microsoft only officially supports remote access to Team Sysem through VPN!

That's kind of a bummer. Rob Caron elaborates:
Team Foundation client applications, such as Team Explorer, access Team Foundation Server functionality through a collection of Web services hosted on Internet Information Services (IIS) 6.0. The initial RTM release of Team Foundation Server only supports Integrated Windows Authentication, which allows clients to use their Windows credentials to access this functionality.
 
Integrated Windows Authentication [previously known as NTLM] is an ideal choice for most deployment scenarios in a corporate environment, but it is not an optimal choice in Internet scenarios due to limitations resulting from proxy servers, firewalls, and trusted connections. For this reason, we originally planned to support Basic and Digest authentication as well.

Unfortunately, we were not able to complete this implementation in time to ship with the initial RTM release of Team Foundation Server. We are continuing to work on adding this support in the near future, which should be available sometime soon after the release of Team Foundation Server. However, this means that Team Foundation Server does not immediately support some scenarios, such as accessing Team Foundation Server through a proxy that does not maintain a connection between the client and server.
Team Foundation Server is driven through a collection of web services, which you can plainly see if you browse IIS on the web tier:



This is all standard IIS 6 stuff, which means you can expose these web services securely through HTTPS and SSL. Right click the website and select Properties, then visit the Directory Security tab. It's right there under the Secure communications group:



But there's a catch: some proxies don't properly pass NTLM/IWA credentials, so even though users may be able to get to these web services via HTTPS and SSL, they may not be able to successfully authenticate. It all depends what kind of proxies they're passing through on the way to your site.

There's a walkthrough on setting up SSL for Team Foundation Server on the Configuration and Management of Team Foundation Server Quickstart page, but clicking on that link results in, err..
well, nothing. Yet. I'm sure eventually there will be an article of the high quality we typically expect from MSDN in the spot of that.. placeholder text.

In the meantime, I found Ognjen Bajic's Word-to-HTML transcribed walkthrough, Enabling Team Foundation Server SSL. I think it's a bit more complex than it needs to be, but it's definitely a good starting point for those of us interested in exposing VSTS through the internet without VPN.

posted by jatwood with 20 Comments

Show Deleted Items in Team Explorer


There's a semi-hidden checkbox in Tools, Options, Source Control, Visual Studio Team Foundation that enables deleted items in source control explorer:



Once you tick this checkbox, you'll see all the deleted files in the source control explorer:



Great option-- now that the deleted items show up, you can right click them and select Undelete to bring them back from the dead!

posted by jatwood with 0 Comments

Differencing Word documents

If you store Microsoft Word documents under version control, you may naturally want to know what changed between one version of a Word document and another. Unfortunately, Microsoft doesn't provide any comparison tool to do this. But there are some third-party alternatives that can visually compare changes in Word documents:

DeltaView Personal Edition

DiffDoc

Both of these tools support command-line comparisons, which means they can be used as custom compare tool in Team System.

For DeltaView PE:

C:\Program Files\Workshare\DeltaViewPE\
DeltaVw.exe /original="c:\doc1.doc" /modified="c:\doc2.doc"

For DiffDoc:

C:\Program Files\Softinterface, Inc\DiffDoc\
wdd.exe /M c:\doc1.doc /S c:\doc2.doc

posted by jatwood with 0 Comments

Class Diagramming, UML, and Team System


I recently found out from Brian Randell that the class diagramming support found in almost every edition of Visual Studio 2005 (standard and up) was inherited from Team Edition for Software Architects. If you want to diagram a full blown..
  • Application
  • System
  • Logical Datacenter
.. then you'll need Team Edition for Software Architects (or the full suite). But the core class diagramming functionality was deemed so critical that it was pushed all the way back down into Visual Studio 2005 Standard! And it's the real thing, with complete two-way editing support and all of the other trimmings that are provided for the other diagram types in the Architect edition. Nothing was cut or hobbled. How cool is that?

I was reminded how nifty the class diagramming functionality is when I saw it used in this sample implementation of a ZIP class for .NET 2.0. So I set out to duplicate that diagram. Here's how you do it:

First, right-click the class you want to create a diagram for in the Solution Explorer, and select View Class Diagram.



This creates a new class diagram file ClassDiagram1.cd in your solution (for this class, natch), opens it, and also opens the Class Details tool window.



Let's remove the two class diagrams we don't want by right-clicking them and using their context menu. But be careful! Remember this is true, "live" two way editing. There's Delete Code and Remove Diagram. We don't want Delete Code. ;) Now, expand the two remaining classes:



Pretty cool, eh? And it gets better: you can CTRL+C these classes to paste them into other apps (Word, etc) as the pretty images -- exactly as shown here.

And again, although the class diagramming is a standard feature in Visual Studio 2005, it's identical to how Architect edition works for the other diagram types. If you like the class diagramming, you'll totally dig the Application, System, and Logical Datacenter diagrams.

Now, these class diagrams are great, but they aren't technically UML. UML is a more formal representation. If you're not familiar with UML, try these brief tutorials:
If you want UML diagrams in Visual Studio 2005, you can use the "Visio and UML Modelling" support included in every Team System Edition. However, it's not integrated into the normal install. You'll need to install "Microsoft Office Visio for Enterprise Architects", which is in the \Visio folder of the product DVD.

Once you do so, you can use the Project | Visio UML | Reverse Engineer command to create a new Visio document in your solution. All the UML functionality in Visio can be accessed, appropriately enough, via the UML menu:



Note that we can generate code from our UML diagrams, but it's a far cry from the seamless and intuitive two-way support provided with the built-in class diagrams.

This version of Visio bundles the full palette of UML stencils, although there are alternative, simpler UML stencils available for Visio as well:



Below this, you'll see the Model Explorer, which contains the reverse-engineered bits of your code:



If I drag and drop the ZipEntry and ZipFile classes on the blank Visio document surface, I get a comparable UML representation of these classes:



It's the correct UML representation of these classes-- but it's not nearly as pretty as the Visual Studio version. Clearly there's some overlap here. So when do you use UML, and when do you use the Visual Studio Class Designer? Keith Short provides some guidelines:

We recommend UML and UML-based tools for

  • Sketching,
  • White boarding,
  • Napkins,
  • Documentation,
  • Conceptual drawings that do not directly relate to code.

We recommend [Visual Studio diagramming tools] for

  • Precise abstractions from which code is generated
  • Precise abstractions that map to variabilities in frameworks and components
  • Precise mappings between DSLs
  • Conceptual drawings that have precisely specifiable mappings to other DSLs or to code artifacts.
As a general rule, I think you're better off avoiding UML altogether, unless it's required on your project.

posted by jatwood with 1 Comments

Cliff's Notes for a Team System Install


Evaluating Team System is easier than you think. You can freely download everything you need to start working with Team System today:
All you need to provide is an existing install of Visual Studio 2005* (Standard or better) on the client, and a suitable server (or virtual machine) running any flavor of Windows Server 2003**.

Once you've obtained all the prerequisites, you can start the install.

The first thing to install is Team Foundation Server. It's a little involved, so take a quick look at the Team Foundation Install Guide first. It's a lot of text. Okay, it's too much text. Don't you wish you had the Cliff's Notes for the TFS install?



Now you do.

If, like me, you're way too lazy to read the entire install guide, here is the absolute minimum you need to read to complete the single-server install. And yes, you do need to do it in this order. Note that, if I don't list a step here, I implicitly mean take the default -- whatever that happens to be. And if there's any question about any of this, don't listen to me! I'm just Some Guy on the Internet(tm)! Refer to the official install guide, man!
  1. Create the user accounts you will need for setup

    domain\TFSSETUP
    domain\TFSSERVICE
    domain\TFSREPORTS

    TFSSETUP must be an administrator. The other two are plain vanilla users, but you must grant them the Log on Locally permission.

    These can be either local machine or domain accounts (all on the same domain), but if you want better integrated authentication support, make them domain accounts.

    After creating the accounts, log in as domain\TFSSETUP to finish installing everything else.

  2. Make sure IIS 6 is enabled

    ASP.NET must be installed. Be sure that the Frontpage Extensions aren't installed, but they typically aren't by default. Optionally, you may also want SMTP for the outgoing Team System email notifications.

  3. Install SQL Server 2005

    On the "Components to Install" page, select everything except Notification services.
    On the "Components to Install" page, click the Advanced button at the bottom. You'll do three things here:
    1. Turn off everything under Client Components except Management Tools
    2. Turn off the entire Documentation and Samples node.
    On the "Service Account" page, select "Use the built in System account", and select "Local System".
    On the "Service Account" page, check all the items under "Start services"

  4. Install required hotfixes and service packs

    Stop the SQL Server Browser service. Install SQL Server Service Pack 1. Reboot if necessary.
    Install .NET 2.0 Service Pack 1 (if available), otherwise install the .NET 2.0 hotfix from the \KB913393 folder of the TFS Server installation media.

  5. Install SharePoint Services

    Select the "Server Farm" install. Don't make any changes to the install after it completes; leave it as-is.

  6. Install Team Foundation Server

    Select the "Single Server" install type.
    Use the appropriate accounts we created in step 1 for each account, as prompted.

  7. Verify your install

    Launch a browser and navigate to http://localhost:8080/services/v1.0/Registration.asmx
    Click the GetRegistrationEntries link
    On the GetRegistrationEntries page, click Invoke.
    Verify that you get XML back with the text vstfs in it.

  8. Install the Team Explorer add-in on the client

    Mount the Team Foundation Server install CD on your client computer (the one with an existing install of VS 2005).
    Click the "Install Team Explorer" link.
At this point you should have a fully functional install of Team System. Wasn't that easy?

Fire up Visual Studio, and use the new Team menu to get started.

* If you don't have Visual Studio 2005: Get the 180-day trial edition. Snail mail only, sadly.
** If you don't have Windows Server 2003: Get the 180-day trial edition. Ditto, snail mail.

posted by jatwood with 19 Comments

The Team Foundation Power Toy and Undo Unchanged


Buck Hodges' Team Foundation Power Toy has some functionality that-- to quote Buck directly-- "fills some of the gaps in V1". You can obtain tfpt.exe from the Visual Studio 2005 SDK. Unfortunately the SDK is still in beta; in the latest March CTP, tfpt.exe is located in this folder:

C:\Program Files\Visual Studio 2005 SDK\2006.03\VisualStudioTeamSystemIntegration\Utilities\Team Foundation Power Toys

Here's the basic help text for TFPT; Buck's word documentation goes into much more detail.

TFPT - Team Foundation PowerToys

Type tfpt help for full description

Commands:
tfpt annotate Display line-by-line change information for a file
tfpt getcs Get only the changes in a particular changeset
tfpt history Show the history of an item
tfpt online Pend adds, edits, deletes to writable files
tfpt review Review (diff/view) workspace changes
tfpt rollback Pend changes to roll back a changeset
tfpt unshelve Unshelve into workspace with pending chanages
tfpt uu Undo changes to unchanged files in the workspace

As you can see, there are a number of interesting, useful commands here that you can't accomplish from within the Visual Studio IDE (yet). The particular command we're interested in is Undo Unchanged, which is equivalent to the "Revert files that were not changed" command in Microsoft's internal Source Depot version control system:

The uu command pares down your checkouts to only the files that have actually changed, and it undoes checkouts for files that haven't actually changed.

This is useful in a number of circumstances. In our case, we have to do this because of the subfolder file overwrite bug in Team System RTM.

Let's start by checking out all the files in a subfolder of a solution:

We now drag and drop (or add via the menus; doesn't matter which) a modified copy of TextFile1.txt into the Subfolder of the solution, overwriting the existing one. We could have added 1 file, or 50 files. Now we don't know how many files have actually changed, as our pending changes shows everything in the subfolder. Sure, we could just check everything in and see what actually gets resolved, but maybe we'd like to know what we're checking in before we do it, eh?

Let's run the Undo Unchanged command to get rid of the non-modified files. Note that this has to be run from a path somehere in your workspace or you'll get a "unable to determine the workspace" error.

C:\Projects\ConsoleApplication1>tfpt uu
Bringing the workspace up to the latest version...
Getting the list of pending changes for your workspace...
Building the list of redundant changes...
edit (contents match): c:\projects\ConsoleApplication1\ConsoleApplication1.csproj.vspscc
edit (contents match): c:\projects\ConsoleApplication1\ConsoleApplication1.csproj
edit (contents match): c:\projects\ConsoleApplication1\Subfolder\Class1.cs
edit (contents match): c:\projects\ConsoleApplication1\Subfolder\Class2.cs
edit (contents match): c:\projects\ConsoleApplication1\Subfolder\Class3.cs
Do you wish to undo these redundant pending changes? (Y/N) Y
Undoing redundant changes...
Undoing edit: ConsoleApplication1.csproj
Undoing edit: ConsoleApplication1.csproj.vspscc

Subfolder:
Undoing edit: Class1.cs
Undoing edit: Class2.cs
Undoing edit: Class3.cs
5 changes undone.

Now if we refresh our project display, we see that the pending changes are reduced to only the file we actually changed:

Now we know which files we overwrote in the solution.

posted by jatwood with 2 Comments