Monthly Archives: October 2008

TFS 2008 and SQL Server 2008 on one machine

Some days ago, I installed Team Foundation Server 2008 on one box with SQL Server 2008. Everything seemed to function well, but since the installation of TFS 2008 ‘at least one service did not start up’.

Digging into the event viewer, I discovered TFS Scheduler did not function well. It did not start up because it could not find the TFSIntegration database. The reason? It starts up in racing condition with MS SQL Server. To solve the problem, I added a dependency for the TFS Scheduler service on MSSQLSERVER. Problem solved!

The link on how to perform this task: http://support.microsoft.com/kb/193888. If you need more information, send me a message ;)

Alternative SMTP server

Yesterday I discovered that about half of all emails sent using my ISP’s SMTP server are rejected by my recipient’s mail servers. The reason: since a long while my personal ISP, Online (former Orange, even more former Wanadoo) is blacklisted for spam reasons.

As I understand when surfing the Internet for this problem, many users suffer from the same problem. I decided it was time to do something myself, as I cannot rely on the SMTP server anymore. Therefore I looked for a reliable SMTP relay server (paid, to prevent myself to overcome the same problem again). That particular relay server must support the Exchange Server’s smart host on an alternative SMTP port, since Online has closed port 25.

Since a couple of hours I use the mail relay service of DNSexit for just a few bucks per year. All functions wonderful, my mail arrives again (not unimportant). I also tried using SMTP2GO, but unfortunately they do not support an Exchange Server smart host.

Multicast delegate invocation

Today I remembered the need to blog again. It sounds weird, but it isn’t :) … A while ago I ran into a failing multicast delegate and decided to blog it. Since I ran into one again today and having to look up my previous solution again the hard way, I discovered I should have done it immediately. Check the story below:

Multicast delegates are great. Today I had to implement a custom user control (insurance cost calculation) with several child controls (one for each prospect) which depend on each other (e.g. parent and children). I use a delegate to notify the parent control that one of it’s children selections has changed.

The original call:

public event EventHandler SelectionChanged;

/// <summary>
/// This method cares for correct event handling
/// </summary>
private void OnSelectionChanged()
{
  // The SelectionChanged event will be null if there are no subscribers.
  if (SelectionChanged != null) SelectionChanged(this, EventArgs.Empty);
}

For some dumb reason I ran into a NRE using the delegate. Guess what happened? Subsequent delegate subscribers did not get fired anymore. The reason is that a delegate that fails for some reason, fails entirely. After researching the problem again, I changed the code provided hereabove with the following piece of code:

public event EventHandler SelectionChanged;

/// <summary>
/// This method cares for correct event handling, including the protection against
/// failing individual event subscribers
/// </summary>
private void OnSelectionChanged()
{
  // The SelectionChanged event will be null if there are no subscribers.
  if (SelectionChanged != null)
  {
    try
    {
      Delegate[] list = SelectionChanged.GetInvocationList();
      foreach (Delegate del in list)
      {
        try
        {
          // Only the current subscriber will file, the rest of the delegate's
          // invocation will proceed as normal.
          EventHandler handler = (EventHandler) del;
          handler(this, EventArgs.Empty);
        }
        catch { }
      }
    }
    catch { }
  }
}