Wednesday, 27 August 2008

Installing CruiseControl.NET on Windows Server 2008

We’ve been running CCNet on a very old workstation, and the build times were starting to get rather long. To fix this, we’ve had a new Windows Server 2008 virtual machine provisioned.

These are roughly the steps I followed to get things up and running:

  1. Enabled IIS 7, WPAS and SMTP
  2. Installed .NET 3.5 SP1
  3. Installed CruiseControl.NET 1.4
  4. Updated web.config to allow webdashboard to run in integrated mode by adding the following section:
<system.webServer> 
    <handlers> 
        <add name="*.xml_*" path="*.xml" verb="*" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard" preCondition="integratedMode,runtimeVersionv2.0" /> 
        <add name="*.aspx_*" path="*.aspx" verb="*" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard" preCondition="integratedMode,runtimeVersionv2.0" /> 
    </handlers> 
    <security> 
    <requestFiltering allowDoubleEscaping="true" /> 
    </security> 
</system.webServer>

  1. Installed applications required for building and testing:
    • CollabNet SVN 1.5.1
    • TortoiseSVN 1.5.1
    • Gallio
    • FxCop 1.36
    • Sandcastle
    • Sandcastle Help File Builder
    • Windows SDK for Server 2008 (just dev tools)
    • Report Viewer 2008 SP1
    • SQL Server Express 2008
    • Change CCService to run as Automatic and as specific ‘build’ user.
    • Grant ‘Modify’ access to ‘build’ user to ‘C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files’.

One issue I did find right at the end – one of our tests was failing with this unusual error:

System.Windows.Markup.XamlParseException: 'DockPanel' object cannot be added to 'Viewbox'. Exception has been thrown by the target of an invocation. Error at object 'System.Windows.Controls.DockPanel' in markup file 'AbbGrain.Aom.Client;component/shell.xaml'. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80070018): The program issued a command but the command length is incorrect. (Exception from HRESULT: 0x80070018)
at MS.Internal.HRESULT.Check(Int32 hr)
at System.Windows.Media.MediaSystem.Startup(MediaContext mc)
at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher)
at System.Windows.Media.MediaContext.From(Dispatcher dispatcher)
at System.Windows.Media.Visual.VerifyAPIReadWrite()
at System.Windows.Media.Visual.VerifyAPIReadWrite(DependencyObject value)
at System.Windows.Media.VisualCollection.VerifyAPIReadWrite(Visual other)
at System.Windows.Media.VisualCollection.Add(Visual visual)
at System.Windows.Controls.Viewbox.set_InternalChild(UIElement value)
at System.Windows.Controls.Viewbox.set_Child(UIElement value)

All the more strange, as the test was passing on the old build server and also passed on all our workstations. Turns out it’s a bug in .NET 3.5 SP1.

There’s a comment at the bottom of the bug that changing the service to run in XP SP2 compatibility mode should work around the issue. This didn’t work for me initially, until I realised I needed to click on the ‘Show settings for all users’ and then set compatibility for all users. eg.

Compatibility for all users dialog

Restarting the service then saw the WPF test pass.

Tuesday, 26 August 2008

HasMany and null foreign key columns

I’ve been trying to figure out why our data layer wasn’t saving a new item that we’d added to a [HasMany] collection.

To figure out what was happening, I build a simple sample based on the examples from the Castle ActiveRecord documentation.

ClassDiagram1

This generates a database schema like this:

BlogPostTableDiagram

Normally you’d make the foreign key column ‘blogid’ not null, but (as mentioned in this thread) for NHibernate, it does an INSERT then an UPDATE so the foreign key column does need to be nullable.

I can understand this might be the case if the Blog entity hadn’t been saved, but it is surprising that it doesn’t recognise that it could use a single INSERT statement if it does know the foreign key value.

Monday, 25 August 2008

NHibernate 2.0 GA

Fabio announced that version 2.0 of NHibernate is now released. This is great timing, as we’ve been using the release candidate for a few weeks now.

Download from SourceForge.

Unfortunately this release doesn’t include LINQ for NHibernate, but the word on the street is that is planned for 2.1. That will be a really useful addition. I’d much prefer to use LINQ to write queries and let the compiler check the syntax rather than have HQL strings that I only find out at runtime are incorrect.

Friday, 22 August 2008

UrlScan v3.0

Version 3.0 of this useful filter has been released. Just the thing to help keep the nasties out of your IIS server.

Nazim summarises the new features.

Thursday, 21 August 2008

And the winner is…

Last night the SA finals of Microsoft’s Demo competition were held. The state finalists were:

Andrew Coates hosted the show (well there were only the five of us there, so it was a small show) and also judged the presentations. At the conclusion, Andrew announced that Nigel was the winner!

After we posed for a photo in our very trendy bright orange T-shirts, Andrew then took us out to dinner along with Darren Neimke (who happened to be in the neighbourhood).

It was a great night, and all the best for Nigel in the national finals to be held at TechEd 2008 in Sydney in a couple of weeks.

Monday, 18 August 2008

Sticky taped

Taped I obviously haven’t been as productive as my ABB colleagues thought I should be, so they kindly taped up my mouse – presumably to encourage me to use the keyboard more.

I’m not sure what they’re saying by taping up my phone and my chair though.

Or maybe things just got extra silly on Friday afternoon after I left :-)

Friday, 15 August 2008

Teracopy

I saw this tool mention in a LifeHacker post last month and thought I’d try it out.

Copying large (or lots) of files with Windows Explorer can be an interesting experience, but Teracopy improves on this quite a bit.

I like it.

Thursday, 14 August 2008

Compiling the NHibernate 2.0.x branch

I downloaded the latest code for NHibernate 2.0.x from the Subversion repository.

When I ran nant to build the code, it was displaying a whole bunch of errors as soon as it got to the Iesi.Collections.Test project:

NH2.0.x-branch\src\Iesi.Collections.Test\Generic\HashedSetFixture.cs(7,7): 
error CS0246: The type or namespace name 'NUnit' could not be found (are you missing
a using directive or an assembly reference?)

Turns out because I’m using a current nightly build of nant, it defaults to .NET 3.5. Forcing it to use .NET 2.0 (using the –t argument) seems to do the trick. eg.

nant -D:with.core.only=true -D:skip.tests=true -t:net-2.0

Wednesday, 13 August 2008

Error installing SQL 2008

I just had the following error appear near the end of installing SQL 2008 management tools:

The following error has occurred: 

Unable to get installer types in the C:\Program Files\Microsoft SQL Server\100\Tools\Binn\Microsoft.SqlServer.Management.PSProvider.dll assembly.

Not sure what that means.

Finishing the Home Theatre PC

You might recall that I discovered one of the hard disks I’d purchased for my HTPC was defective. It was sent back, but I’ve had to wait for a replacement to arrive. It finally came in, and on Saturday I picked it up along with the Shintaro Wireless Keyboard.

As an interim measure, I’d installed everything on the WD 1Tb drive, but now I could use the Seagate drive as the system disk (Operating System, etc) and leave that 1 Terabyte of space for recording data.

While I had the case open, I also took the opportunity to remove the extra video card (my experiment with composite video had failed, and the onboard video should be more than adequate).

I then re-installed Vista onto the new drive (which pleasingly was noticed immediately by the BIOS – no problems this time!)

As it was more than a month since the original build, I checked to see if any new drivers were released:

I thought I’d be clever and configure the Free*EPG TV Guide settings before starting up Media Center, but that didn’t seem to work. After I’d gone through the Media Center configuration process and then closed MCE, I ran the Free*EPG tool again and things went better.

Everything was up and running again.

Shared media

I’ve heard about Media Centre Extenders, but never saw anything about how MCE can talk to other regular Windows machines. Well it turns out it is quite simple. You can point MCE to a network share in the Library settings, and then  you can browse all your digital photos and listen to your CD collection remotely.

Add-ins

I also wondered if there were any interesting add-ins for MCE. There’s quite a list mentioned in the Media Center forms on The Green Button.

I’ve installed the following to start off with:

  • Heatwave – displays the current and forecast weather
  • TVTonic – Internet TV and video podcasts

TVTonic comes with a whole lot of channels to choose from, but you can also add your own custom RSS feeds to the list. I added the feed for dnrTV, and it worked straight away.

A quick warning though – don’t forget that you’re downloading all that video, and like me you might discover that’s a great way to use up almost all of your broadband quota for the month! At least Internode are responsible and send you warning emails when you’re getting close to the limit. We normally don’t get anywhere near the 10Gb a month limit, so this is something I’ll need to monitor.

It does raise an idea for my own MCE add-in – A Media Center Usage Meter for Internode. Now just to find the time to do it!

Friday, 8 August 2008

All the best, Brenton and Hayley!

Brenton and HayleyIf you happen to watch the Channel 9 News on a weeknight in Adelaide, then you’re probably familiar with their weatherman, Brenton Ragless. You might also recognise his dulcet tones from one of his radio and TV advertising voiceovers, CFS spokesperson,  radio presenter on LIFE-FM, or maybe even the funny guy on the PA at the Blackwood Christmas Pageant.

I’ve known Brenton over the years through cake decorating (no, not us - our Mums) and Church circles, and now that he’s a big time TV personality, it’s quite nice for my kids to say “Daddy, isn’t that the man you know?”. I’m not famous, but at least I know someone who is :-)

Well the great news is Brenton and his fiance Hayley are getting married tomorrow, and I thought it would be nice to publicly wish them well.

I’m not sure if I’ll be able make it to the ceremony, but I hope everything goes well (even if the weather looks like it might be a little inclement – you’d think Brenton would be able to fix that!)

Thursday, 7 August 2008

SQL Server 2008 RTM

It looks like SQL Server 2008 is now done. Various bits are starting to appear on Microsoft Downloads, including Sync Framework v1 and Sync Services for ADO.NET v2.

The sync files are downloadable separately as part of the Feature Pack.

There’s also 2008 Books Online, and some 180-day trials of SQL Server 2008 Enterprise Edition – one for IT Pros and one for Developers.

Hopefully the Express versions will appear shortly. Greg says Visual Studio 2008 SP1 will come out on August 11th.

Wednesday, 6 August 2008

Welcome Ben

Monday saw Ben Laan join our team. The “Dream Team” is now complete and it’s all systems go.

Tuesday, 5 August 2008

SQL 2008 RC0 misery

On my old (and slow) work PC I had installed SQL 2008 RC0 and it worked fine.

I tried to install it on the new box and it has ended up causing me grief. The first indication that all was not well was when I tried to launch Visual Studio 2008 after SQL installation had completed. I was greeted with the following error:

"Package 'Microsoft.VisualStudio.Xaml' has failed to load properly"

Googling this error unfortunately didn’t give any ways to fix it, apart from reinstalling VS 2008.

So that’s what I did. I got rid of all the Visual Studio and SQL products using Add/Remove.

I then also fired up RegEdit and deleted their registry settings and clobbered their Program Files directories just to make sure. Reinstalling took a few hours, but was uneventful.

I then fired up Visual Studio again, only to see this new error when I tried to run our project

Unable to load DLL 'wpfgfx.dll'

It appears this is caused by some remnants of .NET 3.5 SP1 beta not being removed.

Rather than repeat the whole install process again, this time I just uninstalled all the .NET frameworks, used this tool to make sure, then finally clobbered the c:\windows\assembly and c:\windows\microsoft.net folders, before re-installing .NET 3.5 again.

Because some of Visual Studio’s assemblies would also have been clobbered, I then did a Repair.

All seemed ok, until I tried to use SQL Management Studio. Of course it had some managed assemblies too, but unfortunately I couldn’t see a way to repair it. Instead I uninstalled all the SQL bits again and reinstalled them.

Now everything appears to be back to “normal”.

Friday, 1 August 2008

SQL Express user instance failing when using RDP

I thought I’d log in via Remote Desktop to do some extra work from home. I attempted to run the database unit test project only for all the test to fail with the following error:

“Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.”

Turns out this is a bug in Windows XP SP2.

I installed the hotfix using Microsoft’s new Hotfix request service, and the problem is fixed.