Blank page in Umbraco site after installing Vega IT’s uSiteBuilder

I ran into some trouble after installing Vega IT‘s uSitebuilder NuGet package on my newly created Umbraco website. The whole site suddenly went blank, and all I could get from the network traffic was a 500-error without body. Nothing was being written to the logs either.

I’ve seen blank pages before, and sometimes they’re caused by broken configuration files, so after examining my web.config file more closely I noticed that I had a duplicate row in there.

Vega IT's uSiteBuilder adding module twice in web.config breaking Umbraco CMS.

After removing the duplicate, the website started working again. As I find merge conflicts in configuration files are easier to solve if the files are formatted with one attribute on each row, since you can easily see which attribute has been changed. So I make a habit of always formatting before I save.

<add name="USiteBuilderHttpModule"
     type="Vega.USiteBuilder.USiteBuilderHttpModule, Vega.USiteBuilder" />

Going back to Umbraco, I was presented with the blank page again; and yes, the duplicate module addition was back.

uSiteBuilder inserting duplicate module add nodes if formatting web.config

Sounds weird, I know. Using Ilspy to have a peek in uSiteBuilder’s WebConfigManager (before actually remembering the code is on GitHub), I found that the format is indeed the cause.

Vega IT's uSiteBuilder's source code showing where duplicate rows are added.

During the initialization process, uSiteBuilder looks for a single line string <add name=”USiteBuilderHttpModule” type”Vega.USiteBuilder.USiteBuilderHttpModule, Vega.USiteBuilder” in the module section of the web.config. If you format your file, it will no longer be found and you will get your duplicate.