Switching to Git

I’ve been using subversion for a very long time. During that period I’ve got several people and one company hooked on this version control system after I got frustrated with SourceSafe. SourceSafe was the only version control software developers on the Microsoft platform knew, if they did any. For those people subversion was a giant leap, but once they saw it in action on they’re large .net projects they were sold.
Once I moved to the Mac OS X platform subversion happily travelled along for my local version control.
I’ve always had two main frustrations with subversion:

  1. In a local situation you are stuck with a directory on your system which doesn’t contain anything sensible: your local repository
  2. It is not easy to convert a local directory to a working copy under version control (add/commit/checkout)
    Now I’ve switched to Git and I will undoubtly find issues using it, but so far my two main frustrations are solved with three lines of code
    git init
    git add .
    git commit -m "First commit"

Are you still listening?

Yeah I know, it’s been a while. I’ve been putting this off for a very, very long time.

I used to blog on tech-stuff I ran into in my job, I don’t think that will come back. We’ll see where this is going.

Searching the Java RunTime for Vista 64-bit

I had a hard time finding the correct JRE for my Vista 64-bit installation. Apparantly it’s not on the Www.Java.Com site, at least I couldn’t find it on the downloads page, and don’t get me started on the automated detection/installation procedure at that site. I had more luck on the Sun-site, follow the path of downloads, category, Java, Java 2 Platform Standard Edition, Latest Release (in the top blue header part) for some reason it redirects me first to the Java 5 downloads, Java Runtime 6 update X and there on the bottom the 64-bit for Windows AMD.

BizTalk Web Service Publishing Wizard Error: Method not found: System.Xml.Serialization.XmlMapping.get_ElementName()

I was stunned, I had defined a Request schema and a Response schema to be used by a Web Service I wanted to implement in BizTalk 2004. The Request schema was straightforward, just some fields which made up a Service Request. The response would be a collection of 0 to N “Records”.

I had the Response Schema defined somewhere around the lines of this:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
  targetNamespace="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Record">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Field1" type="xs:string" />
              <xs:element name="Field2" type="xs:string" />
              <xs:element name="Field3" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Looks sensible right? It compiles okay, I can make an Orchestration with a Request-Response port, everything looks fine, until the Web Service Publishing Wizard gives me:

Failed to create project http://localhost/BizTalk_Webservice_Publishing_issue_Proxy.
[Microsoft.BizTalk.WebServices.PublishingException] Failed to construct code for schema "http://BizTalk_Webservice_Publishing_issue.Schema2".
Method not found: System.String System.Xml.Serialization.XmlMapping.get_ElementName().
I didn't get it, what was wrong? After searching the internet (in which I obviously found one of [Patrick's blogpost](http://bloggingabout.net/blogs/wellink/archive/2007/05/22/solving-the-microsoft-biztalk-webservices-publishingexception-with-imported-schema-s.aspx) which didn't help in this case as I had no imported schema's) I began some experiments. I determined that the cause lies in the multiplicity on the **Record** element. It didn't matter what values I used, as soon as the schema allowed more than one **Record** element to be a part of the message, the Wizard failed on me. I don't remember how I got the idea, but the solution is rather simple. It appears that the Wizard doesn't like the multiplicity _on the **element**_. So, let's put the multiplicity one level higher, **_around_** the element, like this:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
  targetNamespace="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Record">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Field1" type="xs:string" />
                <xs:element name="Field2" type="xs:string" />
                <xs:element name="Field3" type="xs:string" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

So after encapsulating the Record element in a Sequence on which I added the multiplicity, all was well. I don’t think I fully understand why the Wizard (or XSD.exe which is running the show in the background) fails on the first version, but now I do know how to solve this.

Update: fixed the formatting of the XML Schema’s for readability.

I want to store more items

I’m running Vista and Office 2007. Previously I used Newsgator for all my blogreading, but the new Windows RSS platform in combination with Outlook 2007 brings me the exact same functionality.

It appears that the feeds have a limit for the number of items they can contain, this limit is by default set at 200. That’s not enough for me. You can set the limit by modifying the feed properties, but that would mean I needed to right-click al the feeds (100+) so I needed another way to modify all the feeds. Of course the Windows RSS Platform has an API, so some programming will come to the rescue. I originally thought that this would be an excellent opportunity to delve into Powershell, but it appears that Powershell is not yet available for Vista at this moment :-(

So some JavaScript to the rescue. Run it using cscript, and all feeds will be modified.

  var feedsManager, rootFolder;
feedsManager = new ActiveXObject(“Microsoft.FeedsManager”);
rootFolder = feedsManager.RootFolder;
iterateFolders(rootFolder);

function iterateFolders(folder)
{
if (null == folder) return;
var currentFolder;
var e = new Enumerator(folder.Subfolders);
for(;!e.atEnd();e.moveNext())
{
currentFolder = e.item();
iterateFolders(currentFolder);
}
iterateFeeds(folder);
}

function iterateFeeds(feedFolder)
{
if (null == feedFolder) return;
var feed;
var e = new Enumerator(feedFolder.Feeds);
for(;!e.atEnd();e.moveNext())
{
feed=e.item();
//feed.MaxItemCount = feedsManager.ItemCountLimit;
feed.MaxItemCount = 0;
WScript.Echo(feed.Name + “: “ + feed.MaxItemCount);
}
}
Update: I previously set the MaxItemcount to the ItemCountLimit (2500), set it to 0 to set it to unlimited

Tagged - 5 Things you didn't know about me.

As I have always believed in the Six Degrees Of Separation, I’m not surprised this whole tagging game eventually ended up here. Thanks to Carlo for confirming my believes.
So here are the 5 things you maybe didn’t know about me.

5) I started programming on the ZX81. I had the 16Kb expansion pack and a lot of my time went into typing in programs from the various magazines (there were a lot of those back then). Later I started writing my own programs. As I’m Dutch and only had very minimal education in English when I was 12, I learned myself to read English in the progress.

4) I have a diverse musical taste. I love to listen to Disco Classics, House, Trance, Rock and Progressive Rock. You can run into me at a Steve Vai concert one week and at Dance Valley the other. Some other concerts (in no particular order) you can have seen me would be from Iron Maiden, Deep Purple, Audioslave, Toto, Simon Phillips, David Lee Roth, Joe Satriani, Dream Theater, Van Halen, Bon Jovi, Whitesnake, Tony Macalpine, Metallica. Some Dance Spots where you can have met me include Trance Energy, Innercity, Tiesto in Concert, Mysteryland, the LoveParade, Parkzicht and de Barocci.

3) I play electric guitar in a band. My guitar had been stolen and after I had spotted it for sale on the internet, hours before I went on vacation to Spain, my friends did enough detective work to have the police get my guitar back, without a scratch.

2) In 1998 I presented a session on TechEd Europe on COM+ Without a doubt it is the largest crowd I have ever presented to.

1) My dad is Indonesian so I’m a half-blood. I guess that’s the reason why I tan so easily and dark, why I prefer heat over cold, why I eat rice at least once a week (and don’t mind to eat it for breakfast, lunch and diner 7 days-a-week) and love spicey food.

Let’s tag 5 more people who aren’t tagged yet, here you go Marcel, Martijn, Ramon, Waseem and Martin

Getting the UK SDC BizTalk 2004 Documenter to run

Finally I’ve managed to get the BizTalk 2004 Documenter to run. If you’ve got problems creating documentation using this tool yourself maybe this will do the trick for you as well. The problem I had was that after the generation a Error box would show up, and nothing was created. After fixing both problems below the tool worked like a charm.

The TMP environment-variable
On the machine I’m currently using the TMP environment-variable was mapped to %userprofile%\local settings\temp and the UserProfile is redirected to a network-share. I changed the TMP environment-variable to a directory on the local drive. You can change this in a dialog which you can edit after pressing the Environment Variables button on the the Advanced tab of the System Properties which you get when selecting Properties from the context menu of My Computer.

The path to Microsoft.BizTalk.XLangView.dll
The documenter relies on forementioned dll. The path to this dll is configured in the Microsoft.Sdc.BiztalkDocumenter.exe.config file. When you’ve got a default install, the path to this dll is set correctly, but in my case BizTalk 2004 is installed on a non-default location, so I had to change this path. It was there right under my nose the whole time…

 

Limiting the AssignedTo dropdown-population for Team Foundation Server workitems

The Situation

You are running multiple Team Foundation Server projects with different developers working on different projects. All of the projects use the MSF Agile process. When a workitem is created (Task, Bug, etc.) you are able to assign a workitem to a designated user. The UI contains with a dropdown which is filled with all TFS users, not just the projectmembers. Furthermore you find it undesirable that new workitems are assigned to the creator by default.

Desired situation

When selecting a person to assign a workitem to, the dropdown is filled with persons assigned to the project’s Contributors or Project Administrator group. New workitems are assigned to no one in paticular. Both new and current projects should work this way.

Steps to get there

Download the process template for MSF Agile using the Process Template Manager.
Modify the files Bug.xml, QoS.xml, Risk.xml, Scenario.xml and Task.xml (located in the "MSF for Agile Software Development - v4.0\WorkItem Tracking\TypeDefinitions" directory) such that

<FIELD name=”Assigned To” refname=”System.AssignedTo” type=”String”>
<VALIDUSER/>
</FIELD>

is changed into

<FIELD name=”Assigned To” refname=”System.AssignedTo” type=”String”>
<ALLOWEDVALUES expanditems=”true” filteritems=”excludegroups”>
<LISTITEM value=”[Project]\Project Administrators” />
<LISTITEM value=”[Project]\Contributors” />
<LISTITEM value=”Unassigned” />
</ALLOWEDVALUES>
<DEFAULT from=”value” value=”Unassigned” />
</FIELD>

The syntax of ALLOWEDVALUES, LISTITEM and DEFAULT as well as some info on expansion can be read in the MSDN Library. After you’ve added users or groups to the project groups don’t forget to do a refresh of the project before opening a workitem, otherwise the list isn’t populated correctly, I think that expanding of the lists is done on the server, not on the client.

To correct any pre-existing projects you’ll have to use the witimport tool to update the template files in each project. So for all your projects you have to run the following commands in a command window (ofcourse substituting the placeholders for your own TFS ServerName and ProjectName):

witimport /t <TFS ServerName> /p <ProjectName> /f <fullPathToModifiedFile>\Bug.xml
witimport /t <TFS ServerName> /p <ProjectName> /f <fullPathToModifiedFile>\QoS.xml
witimport /t <TFS ServerName> /p <ProjectName> /f <fullPathToModifiedFile>\Risk.xml
witimport /t <TFS ServerName> /p <ProjectName> /f <fullPathToModifiedFile>\Scenario.xml
witimport /t <TFS ServerName> /p <ProjectName> /f <fullPathToModifiedFile>\Task.xml

Again, remember to refresh any running Team Explorer instances to receive the changes on the client machines.