Welcome to John Lam (www.iunknown.com)

Here's a guy who needs no introduction. I don't read too many blogs (although that's changing) but John's is one of about 5 that I've read consistently. Every now and then when I do find a blog I like, invariable John's iunknown.com is on that person's list of favourite blogs. John has worked with some amazing people in his career (Don Box, Jeffrey Richter) and I'm looking forward to learning lots from him now that he officially has joined ObjectSharp. John's not afraid to challenge our fundamental beliefs and assumptions (like XML, Function Overloading, and the boolean type to name a few). You can ask him more about that yourself.

TechEd (Day 1): New Sessions on Visual Studio 2005 Team System

A bunch of sessions that were formerly named “TBA” are really about the new Visual Studio 2005 Team System.

  • DEV200 General Session: Managing the Software Lifecycle with Visual Studio 2005   Halls GH
    Tuesday 10:45
  • DEV300 Visual Studio 2005 Enterprise Tools: Software Project Management  Room 20D
    Tuesday 1:30
  • DEVC36 Testing Visual Studio 2005 Applications Using the .NET Framework  Cabana 06
    Thursday 10:15
  • DEV302 Visual Studio 2005 Enterprise Tools: Building Robust and Reliable Software  Room 20D
    Thursday 1:30
  • DEV303 Visual Studio 2005 Enterprise Tools: Enterprise-Class Source Control and Work Item Tracking  Room 20D
    Thursday 3:15
  • DEVC39 Extending Visual Studio 2005 Team System   Cabana 06
    Thursday 5:00
  • DEVPNL4 Enabling the End-to-End Solution Lifecycle: Microsoft Partner Panel  Room 20D
    Friday 12:15
  • DEV356 Visual Studio 2005: Managing the Enterprise Build Process with MSBuild  Room 31ABC
    Friday 1:00

TechEd (Day 1): Play TechEd Buzzword Bingo

Marcie Robillard has put together a fun game for TechEd attendees. You can print out your cards in the Sails pavillion where all those computers are lined up row on row.


Get Ready for some Testing Fun

Burton has finally been officially announced.  The Visual Studio 2005 Team System is basically everything that VSS wasn't. 

  • Integrated Unit Testing
  • Code Coverage Tools
  • Enforced Check-In Policies (e.g. you must pass a unit test before the code can be checked in)

If you are a developer (as opposed to a straight coder), these changes are quite exciting.  I know I was impressed when I first saw them. Look for more information at the AskBurton blog.


Web Services News from TechEd

It has finally happened.  After what seems to be 10 years in the making (but what was probably only a year or so), Web Services Enhancements 2.0 has been released.  It can be downloaded here.

I've been using WSE in a limited role for a while now, mostly because it greatly simplified the attachment of certificates to a web service request.  Beyond this, one of the other nice additions to the standard is it's implementation of WS-Proxy/WS-SecurityProxy.  By using these standards, it becomes easy (as opposed to just possible with WSE 1.0) to send a secure, encrypted message and ensure that the message meets a certain level of security (the policy).

Look for some examples of how to use WSE 2.0 code in this venue over the next few days.

TechEd (Day 1): Balmer's Keynote & Announcing VS 2005 Team System

It's official. I'll post more thoughts and analysis about this as time permits, but, things you should know.

  • Microsoft now has a new Team version of Visual Studio to be delivered “Next Year“ according to Balmer.
  • new source control - more details to follow.
  • Project Management - so dev's will be able to see “Work Items“ in their IDE. There is also supposed to be a sharepoint portal of some kind that dev's & pm's can go to see a dashboard view of a project, milestone's, etc. integrated with MS Project Server.
  • Unit Testing - yes, a very NUnitish thing built right into visual Studio.
  • Code Coverage - yes in the editor you can see what code was executed and what was not.
  • Static Code Analysis - a la fxCop integrated right inside of visual studio.
  • Check in Source control process policy, so a manager type can say “if you check in something, all tests must pass, all static analysis rules must pass, and your code coverage must be 100%“.
  • Also showed was some Load testing stuff that is going to be better than Application Center Test - more on that later.

Of course whitehorse class modeling & SOA designer were showed quickly. Nothing new to announce yet on that front that wasn't covered at PDC....although the guy doing the demo kept saying “Services Oriented APPLICATION” designer. Is this new? Is he changing the acronym from Architecture?

TechEd (Day 0): BOF36: Integrating Unit Testing Tools and Practices Into the Software Development LifeCycle

This BOF went pretty well and a huge thanks to Jim Newkirk for assisting in the delivery. He's a real authority on the practices around NUnit and a good guy to have a round. If you buy his new book on Test Driven Development with Microsoft .NET onsite at TechEd, you can probably catch him at the MS Pavillion to sign a copy.

Some interesting points discussed:

  • Using Unit Tests to drive “example code“ for a framework or class library would be a nice to have.
  • While Code Coverage statistics may satisfy external parties that we've tested what we've developed, percentages are not an accurate measure of code quality.
  • If you write your tests after you do you coding, you already have too much information about your classes that negatively affects how you test.
  • Testing first can really influence (positively) the design of your classes.
  • Developers will work aggressively against source-code check in policies that stipulate a % of code as been covered in unit tests, and that the tests pass, and that they pass static code analysis.
  • It's difficult to test User Interface code, and for a bunch of reason's, not a really good idea or worthwhile investment because the only person who can see your application from the outside in, is through the eyes of a specific user - and you'll never be able to approach that.
  • At the end we also got into some of the difficulties of testing against a database and a bit about Mock objects. That would probably be a good bof on it's own.

Jim might have more comments, but the general feeling I got was that people still need more education about automating unit tests and that not a lot of people are doing it today, let alone Test First. Jim also mentioned that he didn't think it was possible to lecture to somebody and convince them about Test First, but more that it was something that they just really needed to see for themselves. I agree.

DebugView/OutputDebugString Lives in .NET

Back in my COM+ VB6 days I always had a tough time  to
debug into my VB6 components that were running in a dllhost (COM+ Server Application
environment). Basically when the call jumped into the component that was hosted
by COM+ , it would sometimes do funny things like hang the VB6 debug session.

So one method to help debug, was to use an api in the code called OutputDebugString in addition with a little application called DBWIN32.exe, to capture and display the OutputDebugString calls in the code.   
In a nutshell DBWIN32 is a little window that captures and displays any Win32 debug output.
So in the VB6 COM+ component code , basically when I needed to debug something I would put in the

OutputDebugString("I am debugging")

Then if the DBWIN32 window was up and running it would append to it's output:

July 7 2003 10:02:03    I am debugging

Does this work in .NET? -> Yes. But the nice thing about it is that you do not have to
use OutputDebugString API calls to add to the Win32 debug output.

Instead all I have to do is call something that I am sure you are familiar with such as:

System.Diagnostics.Debug.WriteLine("I am debugging"); or
System.Diagnostics.Trace.WriteLine("I am Tracing");

To try this out (if you haven't already, go ahead do it, you might find this useful later!) go to the following
site and download debugview :


This is not a full blown install, but only a zip file with a little exe in it. Once you have unzipped Dbgview.exe:

1) Run Dbgview.exe. The little DebugView window will be launched.
2) Create a new .NET windows or .NET ASP application.
3) Somewhere in the code put (make sure the code is called on startup)

System.Diagnostics.Debug.WriteLine("I am debugging");
System.Diagnostics.Trace.WriteLine("I am Tracing");

4) Compile it, (but make sure that it is the debug version).
5) Run the .exe (Windows) or navigate to the URL (ASP.Net) to run the debug version.
(Note if you are in VS.NET go to menu choice Debug/Start Without Debugging or
the VS.NET Output Window will grab the debug Win32 output)
6) In the Dbgview.exe output window you should see something like:

20 3:35:37  [3476] I am debugging
20 3:35:38  [3476] I am Tracing

Why is this useful? :

1) If you have not set up a listener for your Debug or Trace output, you will
not see the debug or trace output if your are running outside the VS.NET environment.
2) This is extremely useful for Biztalk 2004 debugging , but go here to
see why :
3) If you are bored you can always see what else is logging Win32 debug output.
4) For other Win32 debug output listeners and discussions go here :

Biztalk Server 2004 / InfoPath,Excel / Sharepoint.


In the last month or so I have been using the Sharepoint Adapter for Biztalk 2004.

What the Sharepoint Adapter does in a nutshell is allow Biztalk
Server to poll for documents posted to a Sharepoint Document Library, grab them
and process them. Biztalk Server can also post a document up to a Sharepoint Document Library.

Why should anyone care about this?

1) Sharepoint Web Sites are a snap to set up.
For example : I can easily set up a Sharepoint Site for employees to
submit vacation requests or timesheets.

2) InfoPath and Excel (part of Office 2003) easily integrate with XML Schemas.
For example: The Vacation Request or timesheets that the employee must fill in
can be easily be created using InfoPath or Excel using an XML Schema as a datasource.

3) InfoPath Scares me.
Not because it's difficult to use , but because it is a snap to design a powerful functional 
InfoPath form using an existing XML Schema or a database as a datasource.
With an InfoPath form, you can connect to a Web Service to populate a dropdown,
do validations, and very easily create a smart client interface with minimal coding. InfoPath has a whole host of 
controls such as DropDowns,  Calendars, Buttons , Repeating Tables  Master Detail Tables and many 
more. When the InfoPath document is saved it will automatically populate the XML Schema(s) that it 
is bound to.

Just to give you a high level  workflow that incorporates
Biztalk 2004/ InfoPath / and Sharepoint.

1) The user will go into the Sharepoint Web Site.
Navigate to the Vacation Request Document Library
2) Hit the New Vacation Request form button.
3) Fill out the form.
4) Hit Save.
5) The InfoPath XML document will be saved to the Sharepoint Document Libray.
6) Biztalk will pick up the XML document from Sharepoint and process it.
7) Optionally Biztalk could post the same or another XML document back up to Sharepoint.

Scott Woodgate ( http://blogs.msdn.com/scottwoo ) was absolutely correct in saying that -> What Outlook is to Exchange Server ,
InfoPath is to Biztalk 2004. InfoPath provides a human interface to Biztalk Server.
As for Sharepoint, it is and will continue to be a very popular product.
Mainly because of its powerful configuration properties and I love it because it
integrates seamlessly with InfoPath and Biztalk 2004.


Objects and Web Services

I've  been asked this question enough both on-line and in person that I thought a blog might be a better way to clear up a common misconception. Consider the following situation.  Your application has implemented a class as follows:

public class Dog
   public string Breed;
   public string Fetch()
      return "stick";

As well, the application has a web service method defined like the following:

public Dog GetDog()
   return new Dog();

So let's move to the client side. In a typical .NET application, you would add a web reference pointing to the web service that includes the GetDog method just described.  Under the covers, Visual Studio .NET invokes wsdl.exe to generate the proxy class. Because of the magic of this tool, not only is a proxy for the web service created, but so too is a class that represents the Dog class that is returned from GetDog.  This means that, on the client side, there is no need to deploy the assembly that implements the Dog class on the server-side.  Or does it.

If you open up the .cs file generated by adding the Web Reference (you might have to “show all files” in the Solution Explorer then navigate to below the Reference Map in the Web Reference - the file is called Reference.cs), you will find a class called Dog defined. Does the automatic addition of the Dog class make it easy for developers to work with web services?  Yes. Does it cause some level of confusion?  Definitely.  Which is the reason for this post.

Take a close look at the Dog class in Reference.cs.  What you will see is a class that contains all of the public properties that were exposed by the server-side Dog class.  What you will *not* see is any of the business logic that might have been implemented in the server-side Dog class.  Nor will you see any methods, public or otherwise.  In other words, these two classes are absolutely not the same class, regardless of the similarity in naming. 

What kind of problem does this cause? Say you actually deploy the server-side assembly onto the client and try to pass an object of that type (the server-side Dog class, that is) into the web service method call.  The result is that an apparently inexplicable InvalidCastException error gets thrown.  The reason for the exception is because the server-side Dog class is not the same Dog class defined in the proxy class.  That should make sense now, but it throws a lot of new web service developers for a loop.

There is a solution to the problem.  Once the proxy class has been created, edit the Reference.cs file directly.  Remove the Dog class from that file and change the return type for the GetDog method to match the server-side Dog class.  Now the InvalidCastException will go away.  Keep in mind that, should you decide to refresh the Web Reference, then you will have to make these changes again.  So when I do this kind of manipulation, I would typically use wsdl.exe manually to create the proxy class file and they add it into the project.  This eliminates the potential for wiping out the changes accidentally.