Cannot start service TFSBuildServiceHost on computer 'SERVERNAME'

Posted by Mikael Östberg | Filed under

While installing Team Foundation Server 2010 beta 2 in my current project I encountered the following error while running the Team Foundation Build Configuration Wizard: 

Cannot start service TFSBuildServiceHost on computer 'SERVERNAME'

After checking the Event Log, I saw the following error:

The Visual Studio Team Foundation Build Service Host service depends on the Remote Access Connection Manager service which failed to start because of the following error: 

The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

That service was disabled on the server and after setting it to manual or automatic, the configuration wizard was able to successfully start the TFSBuildServiceHost service.

Please note that the Remote Access Connection Manager in turn is dependent on the Telephony Service, so if it's Disabled as well you need to change the settings for that service too.

Happy configuring!

My Base36 conversion extension method

Posted by Mikael Östberg | Filed under

I made a little method for conversion from decimal to base36. It can be tweaked into converting to any base beneath 36, however.

public static string ToBase36(this int num) {
    char[] chars = "0123456789abcdefghijklmnopqrstuvwxyz".ToCharArray();
    string ret = string.Empty;
    do {
        ret = chars[Math.Abs(num) % chars.Length] + ret;
    } while ((num = num / chars.Length) > 0);

    return ret;
}

log4net UdpAppender on IPv6 (Windows 2008, Vista or 7)

Posted by Mikael Östberg | Filed under ,

I love the log4net UdpAppender.

When you are deploying lots of services to lots of servers usually means that you're having limited possibilities to see what's going on, except checking log files but I find that somewhat cumbersome.

I usually use the UdpAppender for log4net combined with Log4View allows me to sit back and just see the messages roll in. Everything from all servers in real time, beautiful.

I have been enjoying this for a long time now, but in my current project the dev machine is Windows Vista and some of the servers run Windows 2008. They both use IPv6 (by default at least) and that is something that didn't make it into the log4net 1.2.10 release. There are some fixes to log4net, but the 1.2.10 version is compiled into loads of other framworks that I'm using and compiling an own version would cause a lot of pain.

Solution for the pragmatic: Disable IPv6 on the machine

This can be done by following the steps on this page on TechNet.

Basically add or edit the registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents

to 0xFF to disable IPv6 altogether or read the TechNet page to do it more fine grained (it's a bitmask).

Enjoy those Udp datagrams!

Getting fiddler to intercept local request, including requests to Cassini

Posted by Mikael Östberg | Filed under , ,

This is probably something everybody knew but me, but I'll put it here so that I never ever forget it.

It can be very interesting to see what an HTTP based application is actually requesting and that is probably why Fiddler was born. As a developer using Visual Studio and its built-in web server Cassini, I too am interested in what's going on under the hood.

I start my web project from Visual Studio, Explorer opens up. I start fiddler only to see nothing. After a bit of digging online I find that this is easy to solve.

Change http://localhost:1337 to 127.0.0.1.:1337 and fiddler starts tracking my requests.

Note the . before the : in 127.0.0.1.:1337 because that's where the magic is.

Happy fiddling!

Result: Pass

Posted by Mikael Östberg | Filed under

Having some spare time at the moment, I took the .NET certification 70-536. It was my first first Microsoft exam and I thought it was a bit tricky to be honest. I was really confident going to the examination place, wondering if there was a special prize for 100% correct answers. That thought burned after a couple of questions, though.

I passed it eventually and I'm happy I produced something during my interlull (being between assignments as they say).

RESULT: Pass

Feels nice.

On to the next one, which might be 70-503 (WCF) or 70-562 (ASP.NET 3.5).

Nested ListViews with DataPager and custom data source

Posted by Mikael Östberg | Filed under ,

A while back a client ran in to some performance issues using a ASP.NET ListView control along with nested ListViews to enable some grouping capabilities. It worked fine for about 50 rows and a small amount of groups, but one of their customers had over 1000 rows grouped into 15 groups. The page could really use some paging. Without paging, the page took quite a while to render.

I made a sample for them on how to use nested ListView controls with paging on both the outer and the inner ListView controls using the DataPager control. In the sample I also included LinkButtons in both the outer and the inner ListViews to show how to handle command events from within the ListViews.

Live demo of the Nested ListView with DataPager and Custom DataSource sample.

Download the source code

How to prevent web.config inheritance in ASP.NET

Posted by Mikael Östberg | Filed under ,

While setting up this blog, I ran into a configuration issue.

I wanted the blog to be on the URL devva.net/blog so I thought a Virtual Directory would do the trick.

On the root of devva.net, I'm currently running N2CMS. That CMS has the possibility to run several sites in the same installation and I didn't want all of the other sites to have /blog. Neither did I want to run two separate copies of the CMS code.

The solution was a new Web site in IIS pointing the home directory to the CMS Web site directory and then a Virtual Directory pointing to the directory containing BlogEngine.NET.

The problem with that is that the Virtual Directory inherits all the configuration settings from the Web.config in N2CMS, running in the root. This led to several problems like HttpHandlers not being found and such, which isn't strange at all. However, I still wanted this particular setup, so I started looking around on how to prevent web.config settings inheritance from an IIS WebSite to a child Virtual Directory and found a very good solution from Rick Strahl.

As stated in his post, I wrapped the <system.web> section in Web.config with <location inheritInChildApplications="false"> which solved the inheritance problem and as you can see, this blog is working perfectly.