Back in 2003, Korby Parnell listed a couple of tools to switch source control providers. The interesting one was Sourcecode Control Switcher by Soenke Schau. It adds it self into the task tray to make switching providers really simple. I didn't try it, but it looks like it may be a good way to go
Another possibility is to create Windows shortcuts. Make a pair of batch scripts each containing one of the reg command lines that Ed Hintz posted. Then create Windows shortcuts to each batch script, perhaps on your desktop. Right click on each and choose Properties. In the Shortcut tab you'll see a Shortcut key entry. Click in it and press a key. You could assign T (Ctrl + Alt + T) to the TFS MSSCCI provider and V (Ctrl + Alt + V) to the VSS provider.
Of course, you could also have batch files that launch VS after using the reg command line to set the provider as desired.
Aaron Stebner has a nice post showing the steps need to create uattended installations of Team Explorer (aka TFC, Team Foundation Client).
How to perform a silent install of Visual Studio 2005 Team Explorer I have previously posted instructions for performing a silent installation for Visual Studio 2005 and the Visual Studio 2005 Express Editions. A customer read those previous blog posts and asked a follow-up question about how to perform a silent installation of Visual Studio 2005 Team Explorer, which is the client software needed to access Team Foundation Server. Team Explorer setup is architected in a way that is similar to the Visual Studio 2005 Express Editions, but the silent installation instructions are a bit easier because unattended INI file creation was not specifically disabled in setup UI like it was for the Express Editions.
How to perform a silent install of Visual Studio 2005 Team Explorer
I have previously posted instructions for performing a silent installation for Visual Studio 2005 and the Visual Studio 2005 Express Editions. A customer read those previous blog posts and asked a follow-up question about how to perform a silent installation of Visual Studio 2005 Team Explorer, which is the client software needed to access Team Foundation Server.
Team Explorer setup is architected in a way that is similar to the Visual Studio 2005 Express Editions, but the silent installation instructions are a bit easier because unattended INI file creation was not specifically disabled in setup UI like it was for the Express Editions.
On internal mailing list, the following questions came up regarding the auto-generated check-in mails from TFS.
Jeff Lucovsky replied with the following information, which I've edited slightly.
In an earlier email, a similar question regarding work item tracking alerts came up.
Does anyone know of a way to define rules to trigger automated email notifications when a certain field’s value in a work item is changed?
Pete Sheill responded with the following. He's also got a related blog post on using bissubscribe.exe.
There is a way to do it through a command line tool called BisSubscribe, which is available in the SDK. If the field is a string, the filter syntax is the following: "PortfolioProject = '<project name>' AND \”ChangedFields/StringFields/Field[ReferenceName='<field name>']/NewValue\” <> null" Example: BisSubscribe.exe /eventType WorkItemChangedEvent /deliveryType EmailHtml /server MyServer /address me@someplace.com /filter "PortfolioProject = 'My Project' AND \”ChangedFields/StringFields/Field[ReferenceName='System.State']/NewValue\” <> null" If it’s an integer, the syntax is "PortfolioProject = '<project name>' AND \”ChangedFields/IntegerFields/Field[ReferenceName='<field name>']/NewValue\” <> null"
There is a way to do it through a command line tool called BisSubscribe, which is available in the SDK. If the field is a string, the filter syntax is the following:
"PortfolioProject = '<project name>' AND \”ChangedFields/StringFields/Field[ReferenceName='<field name>']/NewValue\” <> null"
Example:
BisSubscribe.exe /eventType WorkItemChangedEvent /deliveryType EmailHtml /server MyServer /address me@someplace.com /filter "PortfolioProject = 'My Project' AND \”ChangedFields/StringFields/Field[ReferenceName='System.State']/NewValue\” <> null"
If it’s an integer, the syntax is
"PortfolioProject = '<project name>' AND \”ChangedFields/IntegerFields/Field[ReferenceName='<field name>']/NewValue\” <> null"
So while I was going through old email, I found another piece of information from Pete regarding the list of server events in TFS v1.
To enumerate the list of event types in a given system you would have to look both at the files in that Transforms folder and in the Registration data (http://machinename:8080/Services/v1.0/Registration.asmx). Inside the Registration data you can see that each registered ServiceInterface can register a list of EventTypes. There is not an API for inserting the event types in the Registration data, but you may use the command-line tool TfsReg to do it. AclChangedEvent BranchMovedEvent BuildCompletionEvent BuildStatusChangeEvent CheckinEvent CommonStructureChangedEvent DataChangedEvent IdentityCreatedEvent IdentityDeletedEvent MembershipChangedEvent NodeCreatedEvent NodePropertiesChangedEvent NodeRenamedEvent NodesDeletedEvent ProjectCreatedEvent ProjectDeletedEvent WorkItemChangedEvent
To enumerate the list of event types in a given system you would have to look both at the files in that Transforms folder and in the Registration data (http://machinename:8080/Services/v1.0/Registration.asmx). Inside the Registration data you can see that each registered ServiceInterface can register a list of EventTypes. There is not an API for inserting the event types in the Registration data, but you may use the command-line tool TfsReg to do it.
You can find more information about the events in the Visual Studio SDK. The current release is Visual Studio 2005 SDK – March 2006 CTP for v2 (free download after you register).
If you need to remove a subscription, you'll need to do it the hard way for right now. The BisSubscribe included in the March SDK doesn't have an option for removing a subscription, even though the RTM code has that option (/unsubscribe). I've sent email about it, so hopefully it will get updated in a future release. In the meantime, Ahmed Salijee has a post on the issue.
[UPDATE 10/07/06] The bissubscribe.exe installed on the AT in the Team Foundation server installation folder does have the /unsubscribe option.
This has come up twice now, so it seems to be worth posting in the hopes that folks will find it when searching for the error message.
Here's the scenario.
Ben Ryan, a developer on version control, describes the problem and the workaround as follows.
The root cause of the problem is that the CMS Service Pack that adds support for Visual Studio 2005 is built against a version of the Microsoft.VisualStudio.Shell.Interop.dll assembly that is incompatible with the version we ship with other products (i.e. VSIP 7.1 and VSIP 8.0). Therefore, the IVsHierarchy that Microsoft.ContentManagement.DeveloperTools.TeamExplorer subclasses cannot be cast to the IVsHierarchy that TFS references in its managed package. We are engaging the Content Management Server team to resolve this issue. In the meantime you can work around the issue by closing the solution and checking in from the Pending Changes toolwindow or by checking the files in from the command line.
The root cause of the problem is that the CMS Service Pack that adds support for Visual Studio 2005 is built against a version of the Microsoft.VisualStudio.Shell.Interop.dll assembly that is incompatible with the version we ship with other products (i.e. VSIP 7.1 and VSIP 8.0). Therefore, the IVsHierarchy that Microsoft.ContentManagement.DeveloperTools.TeamExplorer subclasses cannot be cast to the IVsHierarchy that TFS references in its managed package.
We are engaging the Content Management Server team to resolve this issue.
In the meantime you can work around the issue by closing the solution and checking in from the Pending Changes toolwindow or by checking the files in from the command line.
[UPDATE April 8] The download page works now, and the link is now up to date.
Brian Harry posted an announcement today that there is a new release of the MSSCCI provider for non-VS2005 environments. This one actually has signed binaries. ;-)
Here's the summary from the download page.
Overview The Visual Studio Team Foundation Server MSSCCI Provider enables integrated use of Team Foundation Version Control with products that don't support Team Explorer integration. Instructions Download and run Visual Studio Team Foundation Server MSSCCI Provider.msi on a computer with one of the following products: Visual Studio .NET 2003 Visual C++ 6 SP6 Visual Visual Basic 6 SP6 Visual FoxPro 9 SP1 Microsoft Access 2003 SP2 SQL Server Management Studio
Recently the question of how to compare files and folders came up. TFS version 1 doesn't have the project difference type of functionality that was available in VSS. So if you want to write your own, this code sample will help you with the calls to get the information you'll want to display.
The code shows two different approaches to getting the information. The first approach is to use the GetExtendedItem() method that Source Control Explorer uses to get much of its information (SCE also uses QueryPendingSets() to be able show the other users with pending changes on an item, but I didn't put that in here). Using GetExtendedItem(), you can determine what is different between what's in your workspace and the latest in the repository.
The second approach uses a pair of calls to GetItems(). While it won't show you whether you or others have pending changes, it will show you the differences between two arbitrary versions of the tree. If you want pending change information, you can use GetPendingChanges() and connect the information with what GetItems() returns. You can connect the two sets of data using the item ID in the PendingChange and Item objects, as I have done in the code in order to tell which items are common between the two versions.
This code also shows how to diff two items. The code below uses the Item object to construct a DiffItemVersionedFile, but there are also DiffItemLocalFile, DiffItemPendingChangeBase, and DiffItemShelvedChange classes. While the code produces a text diff, the comments contain details on how to launch an external diff viewer, which is actually simpler than producing a text diff.
If you are just getting started with the version control API, you'll want to start with the basic example. You may also want to look at the example showing how to display sizes and dates of files in the server and how to display the labels on a file.
I've also attached a zip file containing the VS solution for this example. You may need to adjust the project references in order to build the solution. If you haven't already done so, you can add the TFS assemblies to the .NET tab in the VS Add Reference dialog.
You can find the current documentation of the TFS API in the Visual Studio SDK as mentioned here (the current release is Visual Studio 2005 SDK – March 2006 CTP for v2).
Jeff Atwood at Vertigo posted his version of Cliff's Notes for a Team System Install, including links to get the trial versions of everything required. If you aren't going to read the official guide, you might try his approach. I know no one reading this blog would take shortcuts...but just in case.
Meanwhile, you can still get a Virtual PC image with the TFS release candidate from MSDN subscriber downloads. It's under Developers Tools | Visual Studio 2005 | English | Visual Studio Team Foundation Server | Visual Studio 2005 Team Foundation Server Trial Edition (English) | Visual… RC VPC Part 1 of 2 and RC VPC 2 of 2. There's work being done for a new VPC with the final (RTM) release, but that won't be ready for a couple of weeks.