Wednesday 4 February 2009

The "one too many installed .Net framework" time bomb

Today, after installing "Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x86", the Microsoft Internet Explorer 7 in my machine was broken.

I wasn't able to start various web applications anymore.

Also, when trying to check the about screen, I was getting an "Not enough storage is available to complete this operation" error.

Thanks to this, I found out why, and I was able to work that around.

It seems that for each installed .Net framework an empty registry value is added on the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform.
Now, it seems that some Microsoft function is getting all the names of those values, it is concatenating them on a big string, adding 2 characters per name, and if the length of this string exceed 209, IE will stop to work properly.

The work around was as suggested to remove as much names as to shorten that string to a length lesser than 209 characters (counting the 2 already spent for each name!).

In my case, I was having the following names:

.NET CLR 1.1.4322
.NET CLR 2.0.50727
.NET CLR 3.0.04506.30
.NET CLR 3.0.04506.648
.NET CLR 3.5.21022
.NET CLR 3.0.4506.2152
.NET CLR 3.5.30729

They would result on 226 characters (202 + 2*12), which is 17 characters too much. I removed the last value, and everything started to work again I could have removed also just every character after the first 2 ("Of"), and everything would have worked as well, but if we add anything more, IE breaks.

In general, if we find in that key a single value with a name of 207 characters, as such (obviously unbroken):


With this IE7 will work, add a single character more, and IE7 will break.

Now, until Microsoft doesn't properly fix it, the issue at stake here is if this happen, which names(s) should we remove?
On my workstation, for now I removed OfficeLivePatch.0.0, but it may be needed by some other application, so I think we should exercise good sense, and trying to figure out case by case which version of .Net is less probable to be used on a given workstation/server.