IIS Express misdirection

So I maintain multiple branches, one for on-going development and the other for production support. Although Git has a feature to switch branches, it does some magic in the background which moves files and require you either to stash your changes or commit, which can be inconvenient, so instead I have the branches checked out to multiple directories.

This normally works well, unless you use IIS Express for debugging your web solutions. It turns out that IISExpress maintains an “applicationhost.config” file in MyDocuments\IISExpress\config folder. Now this nasty booger seems to know how to change the file selectively, typically when I really don’t want it to.

So as I was making a bug fix today, it managed to switch it automatically as I changed branches and life was good. After that, I go back to my enhancement branch and start cranking away. A few hours later when I’m ready to debug, I launch the app and then I notice funky artifacts in the behavior. I seem to have lost my changes! Or did I?

It was the config file. In it, you’ll find a section that would look similar to the following.


  <site name="Awesome.App.Services" id="1541412810">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="D:\ProductionBranch\Awesome.App.Services" />
      <binding protocol="https" bindingInformation="*:44301:localhost" />
  <site name="Awesome.App.MvcClient" id="1541412811">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="D:\ProductionBranch\Awesome.App.MvcClient" />
    <binding protocol="https" bindingInformation="*:44302:localhost" />


Now, when you work off another branch it theoretically should change automatically for you, saving you from murdering the people near you. However, it likes to only work sometimes and thus you have to change it back manually. After I changed it back, IIS ran from the correct location reflecting my current changes.

Bleeding edge vs Cutting edge

So after returning from Code camp NYC, I got back to the office with a bunch of new toys that I absolutely had to integrate as part of our solution. I started messing around a web framework called “Hot Towel”, which includes “Bootstrap”, “Durandal”, “RequireJS” and “Toastr”. Out of the box, it compiles and the demo thing works great, however the demo is not feature rich, so immediately I’m off for documentation on how to do the next things.

1. Do something after the view is composed
2. Make multiple columns with Bootstrap and the div tag

So starting on the first problem with DurandalJS, I’ve written a framework over Microsoft Prism before, so I understood a lot of the goals of Durandal and I was following the documentation of where to place a function, such that when the view is attached it will fire a function. All over the interwebs, I found the function “viewAttached” and write such a method in my view model to no avail. I stepped through the code and was ready to roll up my sleeves and step through the Durandal code.

However, before I do, something tells me it’s got to do something with the name of the method. So I decided to look up the available methods in a view model and discovered my hunch was correct. There was a breaking change in the official 1.0 release of Durandal that changed the method name from “viewAttached” to just “attached”.

So after the pain of dealing with the Durandal version number, I had another painful distraction of making Telerik ListView control correctly function in acquiring item selected.

Hours after I deal with that, I start digging into the next issue of multiple columns with bootstrap. I’ve followed the documentation and it’s just simply not working. I’m messing with the debugging tools in IE, Firefox, Chrome and Opera, not exactly seeing why the css is not working like the examples on the bootstrap site.


I then finally waded through some magical stackoverflow link to find someone commenting about http://bootply.com/. Where I’m able to test and experiment. However, the class attribute names don’t match the documentation. Surely something is wrong with bootply… then I see it… again!!! literally 4 hours after the previous issue, I still wasn’t smart enough to check it.

The version number was off and there were breaking changes. Breaking changes that altered the class attribute names. Sure enough I update bootstrap and I’m off on my way with working divs.

My lesson learned is that when working on these latest and greatest technologies, make sure to double check versions when looking up articles as breaking changes can really hurt you and consume mountains of time.