Visual Studio Team System and Team Foundation Server Seminar across Canada

In November, 2005, Microsoft launched Visual Studio 2005, a major new release of its developer tools environment, and the foundation of Microsoft platform development for the next few years. In addition, this marked our entry into the lifecycle tools market, with the addition of Visual Studio Team System and the Team Foundation Server, to support end-to-end system development scenarios. We are bringing the tools we have been using for years internally to market to help address customers need to more rapidly develop and deliver solutions that meet the business performance, scalability and end user requirements.

Visual Studio Team System adds significant new capabilities and value to the suite of Microsoft developer tools, with advanced end-to-end role collaboration, real-time reporting and analysis, and a host of new tools covering architecture, development, and testing.

Many of you may have already transition to one of the individual role based offerings in Visual Studio Team System, but are still learning all the new tools and benefits of the offering. This session is intended to provide an introduction to Visual Studio Team System, highlight the new functionality and business value in each offering, and outline the transition steps for existing Visual Studio and MSDN customers. We will also demonstrate Visual Studio Team System in action.

This is your opportunity to attend a free education session and fast track your knowledge and use of Visual Studio Team System.


On-Site VSTS Event Details & Registration:

City: Mississauga
Date/Time: February 22nd 2006 -- 3:00 to 5:00pm
Location: MS Mississauga Office MPR Room
Conference ID: 1032290174
TO REGISTER for this event click here

City: Vancouver:
Date/Time: March 2nd 2006 -- 9:00 to 11:00am
Location: MS Vancouver OFC
Conference ID: 1032290176
TO REGISTER for this event click here

City: Mississauga
Date/Time: March 21st 2006 -- 1:00 to 3:00pm
Location: MS Mississauga Office MPR Room
Conference ID: 1032290177
TO REGISTER for this event click here

City: Ottawa
Date/Time: Apr 19th 2006 -- 1:00 to 3:00pm
Location: MS Ottawa Office Glacier Room
Conference ID: 1032290179
TO REGISTER for this event click here

City: Calgary
Date/Time: May 17th 2006 -- 9:00 to 11:00am
Location: MS Calgary Office Bldg (*TBC) - registrants will be notified of location
Conference ID: 1032290181
TO REGISTER for this event click here
City: Toronto

Date/Time: June 21st 2006 -- 1:00 to 3:00pm
Location: Intercontinental Hotel on Front Street (*TBC) - downtown Toronto
Conference ID: 1032290183
TO REGISTER for this event click here
*TBC – To be confirmed

Alternative Registration Options:

  • By calling 1-877-673-8368 to reserve your place, 24 hours a day, 7 days a week, and quoting the event ID.
  • Register online at by clicking on Search Event or Event ID in the left hand column and typing in the event ID.

Team Foundation Server and SQL Collations

I just got through a grueling session of installing the release candidate for Team Foundation Server. And by grueling, I mean about 16 hours worth. And given all of the glowing reports, I was surprised that this install turned about to be more challenging that the Beta 3 Refresh.

My problem centered around one particular point in the process. After having installed IIS, SQL Server, and Sharepoint Services on a fresh version of Windows 2003 (and the .NET 2.0 Hotfix), the installation of TFS performs a health check. My results coming out of the health check was that the running SQL Server instance was using an unsupported collation. Now while I have installed SQL Server many times, I’ve never given much thought to the collation. So I started looking at the problem. Since I had made no changes during SQL Server installation (with respect to collation), I uninstalled SQL Server and reinstalled it specifically choosing the Latin1_General option. Also, because the instructions in the installation help file said that TFS didn’t support case sensitive, binary or binary 2 collations, I left all of the check boxes on that form blank. To no avail. The SQL Server collation was not supportable by TFS

Just to be clear, after all of the dust had settled, my SQL Server’s collation was Latin1_General_CI_AI and TFS just didn’t like that.

So I go digging into the installation log file and come across the SQL statement which gets executed as part of the collation health check:

SELECT * FROM (SELECT CONVERT(char(100), SERVERPROPERTY('collation')) AS Collation) as c WHERE (Collation LIKE '%[_]CS%') OR (Collation LIKE '%[_]AI%') OR (Collation LIKE '%[_]BIN%') OR (Collation LIKE '%[_]BIN2%')

The thing that stood out for me was the inclusion of the Collation Like ‘%[_]AI%’ clause. Unless I’m reading this wrong, it means that TFS doesn’t like Accent Insensitive collations. And I don’t see this small tidbit documented anyplace.

The sole bright spot is that after I reinstalled SQL Server with the ‘Accent – sensitive’ check box on the Collation Settings portion of the installation checked, all went well. I now have a running version of TFS that is capable of working over HTTP. Let the games begin.


Presentation -> Using BizTalk 2006

Short notice, but I am doing a presentation tomorrow (Thurs. Feb 9) at the Metro Toronto .Net Users Group.
You can read more about it here:

Demos will include dealing with binary documents (Word and Excel) in BizTalk 2006.
The demos will also include:

- The new Sharepoint and POP3 adapters for BizTalk 2006.
- Parsing Excel documents to XML in BizTalk.
- Integration of Sql Server 2005 Service Broker with BizTalk 2006.
- Some of the new and improved features of BizTalk 2006.

So if you are in the area, feel free to drop by.

BizTalk 2006 -> Example using the new POP3 and Sharepoint Adapters

Below is an example using the new POP3 and Sharepoint Adapters (Sharepoint Adapter now out of the box) for BizTalk 2006. This example demonstrates the following:

1) Processing binary documents in BizTalk.
2) A method to process multiple attachments in an incoming mail message.
3) Improvements to the Sharepoint Adapter.

You can download the code at the end of this blog.

The example goes something like this.

A candidate is applying for a job. The candidates resume (Word) and an informational spreadsheet (Excel) are attached to an email message as below:

The resume is in word format, and the excel spreadsheet is as below:

The mail message with attachments is read by BizTalk server. BizTalk server will then add a new item to a Sharepoint Document library. The Word document from the mail message is added as the item's document and the Excel spreadsheet is parsed to populate the First Name and Last Name columns as below:

The sample works as below:

1) A BizTalk Receive Port/Receive Location is configured using the POP3 receive Adapter as below:

Note: The Apply MIME Decoding property is set to false. This is because we want the raw MIME message to be delivered to an orchestration. The two attachments of the message will be dealt with in the orchestration (see below).

2) An orchestration as below will then subscribe to the incoming encoded MIME message:

3) In the orchestration, a receive pipeline (ConstructCandidateInfo Construct Shape) is executed to extract the Excel message out of the encoded MIME message and to also parse the Excel message to an XML format.

The pipeline looks as below:

Note: A MIME decoder is used in the pipeline to extract out the Excel Attachment
Note: The ODBC File decoder  is used in the pipeline to parse the Excel Attachment to an  XML message. This is so the FirstName and LastName can be used to populate the First Name and Last Name columns in the Sharepoint document library list.
Note: Executing receive pipelines in an orchestration is a new feature for BizTalk 2006.

The code to execute the pipeline in the orchestration is as below:

// Execute the Pipeline -> ReceivePipelineCandidateInfo.
// This will create a message with the XML in it
varPipelineOutPutMessages = 
msgCandidateInfo = null;
4) In the orchestration, a receive pipeline (ConstructResume Construct Shape) is executed to extract the Word document.

The pipeline looks as below:

Note: A MIME decoder is used in the pipeline to extract out the Word Attachment

The code to execute the pipeline in the orchestration is as below:

// Execute the Pipeline -> ReceivePipelineCandidateResume.
// This will create a message with the Word Document in it
varPipelineOutPutMessages = 
msgCandidateResume = null;

// Get the FirstName and LastName that are in the Parsed XML Excel message.
// set these into the WSS ConfigPropertiesXml
varXmlDomCandidateInfo = msgCandidateInfo;
varXmlNode = varXmlDomCandidateInfo.SelectSingleNode("//FirstName");
strFirstName = varXmlNode.InnerText;
varXmlNode = varXmlDomCandidateInfo.SelectSingleNode("//LastName");
strLastName = varXmlNode.InnerText;
// Set the first names and last names so they will
// appear in the Document Library Columns
strWSSConfigPropertiesXml = "<ConfigPropertiesXml><PropertyName1>First Name</PropertyName1><PropertySource1>" + strFirstName + 
"</PropertySource1><PropertyName2>Last Name</PropertyName2><PropertySource2>" + strLastName + "</PropertySource2></ConfigPropertiesXml>";
msgCandidateResume(WSS.ConfigPropertiesXml) = strWSSConfigPropertiesXml;
// Set the name of the File, when created in the Sharepoint Document Library
msgCandidateResume(WSS.Filename) = strFirstName + " "  + strLastName + ".doc";

Note: msgCandidateResume(WSS.ConfigPropertiesXml) = strWSSConfigPropertiesXml;
is used to set the First Name and Last Name columns in the document library.

5) The msgCandidateResume message is then sent to the WSS library via a configured
Send Port using the Sharepoint Adapter as below:

Note: That the Column 01, Column 01 Value, Column 02, Column 02 Value, FileName are not configured.
These are dynamically set by the orchestration as explained in 4).

You can download the code HERE. Also look at the ReadMe


1) The new adapters and adapter enhancements for BizTalk 2006 really open up the doors for integrating all sorts of different applications. For a complete list of adapters that will be shipped with BizTalk 2006, please go HERE  
2) You can use the new features of BizTalk 2006 (like executing Receive Pipelines in an Orchestration), to easily process complex messages in BizTalk.
3) Adrian Hamza and his team have developed a top notch, feature rich Sharepoint adapter for BizTalk 2006. For more information on the Sharepoint adapter, please visit Adrian's blog HERE. Adrian also has recorded a series of WebCasts on the Sharepoint Adapter:

WSS Adapter Training Videos:

WSSAdapter-PropsInOrchestration.wmv (28.58 MB)
WSSAdapter-SendReceiveCBR.wmv (10.25 MB)
WSSAdapter-SetupAndConfig-Short.wmv (9.58 MB)
WSSAdapter-InfoPathIntegration.wmv (15.11 MB)

You can download these at BetaPlace (BizTalk Server 2006 section)

To get access to the BizTalk Server 2006 area at BetaPlace, please goto :

Java, .NET, Web Services and Enums

While working on getting a Java Web service and a .NET Web service client to talk to one another, I ran into an interesting situation. The problem had to do with the WSDL being produced by the Java service. Actually, the entire process involved the following steps:

  • An interface written in C# was used to generate a WSDL file.
  • That WSDL file was imported into JDeveloper and a web service was created
  • The WSDL file exposed by the JDeveloper web service was used (through the wsdl.exe tool) to create a proxy class to be used by a .NET client.

The problem was caused by enumerations being used in the interface. The WSDL file generated using the C# interface included defined a separate type (with a base of string) for each enumeration and then restricted the string values for that type. However, the WSDL file exposed by the JDev web service expected that the enumerated parameters would be of type string. Not the restricted, created type that C# wants to send. The resulting type mismatch caused the requests from the .NET client to the Java web service to be rejected with an ‘unknown type’ message.

The solution, while admittedly a hack, demonstrations a little discussed features of enumerations. Consider property called Status that is declared as an enumerated type of CallStatus. I added a field called StatusString defined as below and decorated the Status property with a SoapIgnore attribute as follows:

public string StatusString
   get { return Enum.GetName(typeof(CallStatus), status); }
   set { status = (CallStatus)Enum.Parse(typeof(CallStatus), value); }

public CallStatus Status
{ … }

The SoapIgnore attribute hides the ‘real’ Status property from the SOAP serialization process. Instead the StatusString property, which is used to convert enumerated values to and from a string, is marked as being the ‘Status’ from the perspective of SOAP serialization. One item that may or may not be a problem is that the assigned value of StatusString could be null. This isn’t considered as part of this example, as the Web service was under a compulsion to return a valid value. But if the field is nilable, then you would need to code for that in the StatusString setter.


VSLive 2006 Toronto Dates announced

Not sure this is news to most of you but VSLive is making another trip to Toronto again this year April 24-27th, 2006. It's back at the Toronto Congress Centre out by the airport again (I have mixed emotions about that one). Anyway, make sure to check it out:

Automatic Check-Out Not Working with VSTS/TFS

For the last little while I have been having an issue using source control under TFS. Specifically, when I go to edit a file that (I believe) is under source control, I'm allowed to do so. What's worse, when I go to save the file (like when the application is executed or I'm running through TestManager), I'm told that the file is read-only and I'm asked if I want to overwrite it. Even if I overwrite the file, I still have to go to the Source Control Explorer and manually check the file out for editing. This is, as I'm sure many of you would agreed, annoying beyond belief. I could easily go on for paragraphs about how I'm being taken out of the flow and why isn't this happening automatically.

When I first discussed this problem with others, I was told to go to the Tools | Options dialog box. Once there, in the Source Control | Environment section, there is a couple of controls that control what happens to files upon Saving and Editing. It was suggested that setting these to “Check out automatically” would work.

Unfortunately, this wasn't the first. First off, it appears that these settings are the default values. At least, they were on my system. Frustration ensued for another couple of weeks.

Then, for reasons which I'm not sure of, some of the projects in my solution started acting the way they were supposed to. As I started editing a file, a quick “checking out” message appeared. I was confused, to put it mildly. Not to mention intrigued. As I started looking I found that the working projects contained a file with an extension of .vspscc. This is the source control bindings information for the project. After a little more work, I discovered how to create this file through the Visual Studio IDE. From the File menu, select Source Control | Change Source Control. In the dialog box that appears, the non-working projects will not be bound to a TFS server. Assuming that you are already connected to the correct TFS server, select the unbound projects and click on the Bind button at the top of the screen. This will check out the project files and you will (naturally) need to revolve any conflicts and check them back in. As well, you may need to restart Visual Studio to get the automatic check-out to work (I'm 50-50 on having to do this). But most importantly, source control will now work more like you would expect.

Equality Overloading and Code Analysis

One of the things I like about VS 2005 is the integration of FxCop functionality into the IDE. Most of the time, it informs me of better practices to things that I would have done differently in previous versions of .NET. A good example is the IsNullOrEmpty method on the String class. Code analysis pointed out that, for some of my code, this would be a better performing replacement for the

x == null or x == String.Empty

tests that are quite common on parameter validation.

One of the problems that I ran into, however, was when I was trying to correct a code analysis note about validating arguments. Specifically CA 1062 - Validate Arguments on Public Methods. I had a equality operator overload that looked like the following:

public static bool operator==(BusinessObject x, BusinessObject y)
  return x.Name = y.Name;

The code analysis complaint was that I should be validating the arguments of the public method. OK, I said, and modified the code to the following:

public static bool operator==(BusinessObject x, BusinessObject y)
   if (x == null)
      return false;

   if (y == null)
      return false;

   return x.Name = y.Name;

First off, the reason for the two if statements was because if I only used one, code analysis still complained. But what's worse is that when I ran my unit tests, I got a fatal exception saying that VSTestHost.exe had crashed. Walking through the code, I discovered a fatal oversight that caused the problem. Feel free to take a few seconds to consider the possibilities before reading the answer.

Figure it out?  It's much easier if you debug the app.

The problem is that the if (x == null) line introduces a stack overflow. This is because in order to evaluate whether x equals null, what does the code do? It calls the overloaded equality operator. Over and over again.

The solution is to modify how a null value is checked.

public static bool operator==(BusinessObject x, BusinessObject y)
   if (Object.ReferenceEquals(x, y))
      return true;

   if (Object.ReferenceEquals(x, null))
      return false;

   if (Object.ReferenceEquals(y, null))
      return false;

   return x.Name == y.Name;

Now you should be good to go.

Update: Corrected the fact that I can't write C# code without the benefit of a compiler :) See the comments for the rationale

BizTalk 2006 and the Sql Server 2005 Service Broker Adapter (Beta 2)

Jesús Rodríguez has finished a Beta 2 version of  Service Broker Enhancements Adapter for BizTalk Server 2006. They are looking for beta testers, so please go HERE if interested. Service Broker is an exciting new feature for Microsoft SQL Server 2005. Now you can integrate BizTalk Messaging with Service Broker Messaging, using this important new adapter.


How Do I Revert a Changest in Team Foundation Source Control?

This question came up in our VSTS for Developers Training Course in Toronto this week. One of my students wanted to know how to undo or rollback a checkin, something you could do in Visual Source Safe.

Unfortunately this feature was cut for V1 of Team Foundation Server. Buck Hodges and Brian Harry from Microsoft share how this was a painful cut to help get V1 out the door in this forum post. 

Update: James Manning (via the comments) points out that the Team Foundation PowerToy will do this for you. Great tool btw - check it out. Includes the following tools: Unshelve & Merge local changes, Rollback, Online (syncs offline changes to source control), Get Changset, and Undo Unchanged.