# Thursday, May 22, 2008
« Serializing Optional Value Types to XML | Main | Creating Secondary Web Sites on IIS 5.1 ... »

I've been using the Microsoft SDC tasks to deploy IIS websites, and for the most part this has worked well once I grabbed the latest source from CodePlex; I ran into a few bugs that have been fixed since the last release.

Anyways, I've run into an annoyance with regards to local development builds on Windows XP.  Most of our devs are still using XP for their development platform which as you may know uses an old version of IIS - IIS 5.1.

  • No app pools
  • Single site only
  • No SSL

So, what does this have to do with the SDC tasks?  Well, I want the MSBuild script to fail gracefully with an intelligent error message when run on Windows XP.  Something like:

This version of IIS is not supported, IIS 6.0+ is required.

I couldn't find a decent built-in supported way in MSBuild to get the IIS version, let alone the operating system version.  You would think this would be supported without resorting to C#, but I couldn't find a way.  So what I ended up doing was using the command line "ver" command and piping that to a text file and then reading it back in.  Here's what that looks like:

MSBuild_OSVer

Thursday, May 22, 2008 5:00:00 PM (GMT Standard Time, UTC+00:00)
Wow...that is timely. I'm just starting to use MSBuild for the first time and the SDC tasks on XP. Got some excellent tips from your blog already so thanks for the community service. Do you happen to know if the Web.WebSite.CreateVirtualDirectory is one of the tasks that's a little flaky on XP? It works for me in some cases, but I get consistent HRESULTS from the underlying DirectoryServices stuff as well. Do you happen to know if that's just an XP vs. 2003 Server think? Thanks again, and keep posting those great msbuild tips.
Dylan
Thursday, May 22, 2008 6:53:21 PM (GMT Standard Time, UTC+00:00)
Yeah, the Web.WebSite.CreateVirtualDirectory is the task in particular I was having problems with, it wasn't saving the application pool settings. I think it might have also not saved the authentication type too. Luckily the bug was fixed just a week or two ago, so the latest source from CodePlex definitely helped me out.

Unfortunately I think the SDC MSBuild tasks officially require IIS 6+, IIRC. However, they do seem to work on IIS 5.1 for the most part (except the app pool task). The really strange thing is that I have actually been able to add a second website to IIS 5.1 - it even shows up in inetmgr, it just won't start.
Comments are closed.