TheGeekery

The Usual Tech Ramblings

Visual Studio, IIS, ASP.NET, and bad ordering

For a while, I’ve been doing a little bit of development work, build configurations, and the likes. I’ve had everything running inside a Virtual PC instance due to issues (detailed in Expanding Virtual PC Disks). We’re looking to upgrade to Visual Studio 2008 soon, so I decided to pre-jump.

Like any system administrator, when building servers, we set a sane primary OS disk, and then a secondary data/apps disk. This allows the OS to be kept separate from the applications. In general, that’s a logical operation, however Microsoft likes to go against the grain with the “Common Files” principle. I had a 10GB C:\ for the OS, and a 20GB disk for D:. With Windows installed, and Visual Studio 2005, the C:\ was being a little pushy, and neared being full (about 2GB free)1.

Launching the Visual Studio 2008 setup, it changed the default drive to D:\ instead of C:\, which reduced the disk usage on C:\ from 2.xGB down to 1.5GB… whoa… not pretty. For not installing something on the C:\ that’s an awful lot of disk space.

So I tried to run the install, and it barfed an error about lack of disk space. Come to find out, when running setup packages, it likes to not only write oodles of stuff to the C:\, but likes to dump temp files there too, even though there is a much bigger alternative on another drive. So I tried expanding the disks again like I had last time, but this time Windows wasn’t so happy (it kept complaining about the disk being created with a previous version of windows).

As I really didn’t have much but source files copied from TFS, I decided to rebuild. Here is where my stupidity started…

  • Install Windows
  • Install SR2
  • Install SP2
  • Install Visual Studio 2005
  • Install Visual Studio 2005 Team Explorer
  • Install Visual Studio 2005 SP1
  • Install Visual Studio 2008
  • Install Visual Studio 2008 Team Explorer
  • Install Visual Studio 2008 SP1
  • Download source code from TFS and test compilations
  • Install IIS
  • Setup websites

Those that do any kind of development work with this kind of setup will realize I made a stupid mistake. Visual Studio installs the .NET Framework. 2005 deploys v2, whilst 2008 deploys v3.5. Part of this deployment includes setting up IIS to ensure it has all the right libraries… Anybody clicked on my stupidity yet?

Without noticing what I’d done, yet, I started testing. My ASP pages were coming up, but I was getting 404 messages on .NET applications. I remember the general cause of this being related to IIS not hosting files. Instead of throwing an error like a 500 reporting an error, it throws a 404 which is file missing. A tiny bit miss-leading.

So I start trying to figure out what MIME type I’d missed off in the IIS setup. I remembered that I never had to set MIME types before, so I was digging in the wrong area… Digging some more landed me on Neil Kilbride’s blog, and he details this same issue. So I checked it out, and found part of the issue. I had to permit access to the module, what was different in my case, was that mine wasn’t listed… This is where the light bulb dinged… well more like fizzled on.

Due to the order of install, IIS never got told to install ASP.NET. This is a lot easier to resolve than some people might have thought. Generally people might have assumed you’d need to reinstall the framework, but it’s as simple as telling asp.net to re-register itself. From a command prompt, navigate to the directory for the framework you want to install, then run aspnet_regiis.exe -i. For example, if I wanted to reinstall the v2 framework, it’d look like this:

cd \windows\Microsoft.Net\Framework\v2.0.50727
aspnet_regiis.exe -i

You’ll see a handful of dots appear, then it goes away. Just for luck, I recycled IIS with a quick iisreset, and tried again, and everything was working again.

Next rebuild2, the order will be…

  • Install Windows
  • Install SR2
  • Install SP2
  • Install IIS
  • Install Visual Studio 2005
  • Install Visual Studio 2005 Team Explorer
  • Install Visual Studio 2005 SP1
  • Install Visual Studio 2008
  • Install Visual Studio 2008 Team Explorer
  • Install Visual Studio 2008 SP1
  • Download source code from TFS and test compilations
  • Setup websites

One minor change can save you hours of work…

  1. You should see the “Installers” folder when you install some dev apps 

  2. Because it is windows, and we know there will be another rebuild 

Comments