Richard Szalay

Sunday, August 30, 2009

Hosts File Manager extension for IIS 7

I've just released the first version of my new side project, the Hosts File Manager extension for IIS 7. The extension does pretty much what it says on the can, providing a user interface to edit the local hosts file from within IIS Manager. Running from within IIS gives me a few other benefits, too, like auto-elevation and providing me easy access to local website information.

For now, there's only a global view (accessible from the default "server" view in IIS Manager), but I have more features planned for future releases. You can read about these on the Codeplex project page.

To download it, head over the Downloads page on Codeplex. I've released both x86 and x64 versions, but all my testing has been done with the x64 installer (since I'm running 64-bit Win7). Please log any x86 or Vista issues with the Issue Tracker.

Thursday, August 27, 2009

Debugging IIS 7 extensions in Windows 7

I came across some curious behavior when trying to debug an IIS extension that I'm working on. When I went to select "InetMgr.exe" as the startup program, it wasn't there. I checked the folder using Windows Explorer and, sure enough, there it was. Even entering the path manually resulted in "The external program cannot be found".

So, what was the problem? Well, as far as I can tell, it appears that because InetMgr.exe is an auto-elevated process it is only accessible to other auto-elevated processes. This is quite possibly a post RC solution to the flaw in UAC found during the betas, though I'm just speculating.

Luckily, with a bit of experimenting, I was able to find a solution. By enabling remote debugging ("Use remote machine") and setting the value to localhost, I was able to circumvent whatever was blocking the call. See the below screenshot for clarification.


Debug settings for InetMgr.exe

I am now happily debugging my extension without hassles.

Monday, August 24, 2009

Enable net.pipes in IIS 7 on Windows 7 Professional

I recently went to configure a net pipes service in Windows 7 (Professional 64-bit) and found that it wasn't available. I quickly proceeded to "Turn Windows features on or off", but couldn't find it there either. I eventually found the answer in the Microsoft article WAS Activation Architecture and have simplified the steps below:

  1. Open %windir%\system32\inetsrv\config\applicationHost.config with (elevated) notepad
  2. Find the <listenerAdapters> element
  3. Add a new <add> element with a name attribute of "net.pipe"

The final element should look like this (assuming you have no other listener adapters enabled):

    <listenerAdapters>
        <add name="http" />
        <add name="net.pipe" />
    </listenerAdapters>

Edit: While the above solution enabled net.pipe in the bindings dialog in IIS, it didn't actually enable net pipes in IIS. I did, however, find the correct way of enabling them:

Simply install "Windows Communication Foundation Non-HTTP Activation" from the "Microsoft .NET 3.5.1" section in the "Turn Windows features on or off" dialog.