Friday, October 22, 2010

Microsoft .NET Security Update Fail


 So Windows Update keeps wanting to load a Security Update KB2418241 for .NET 2.0 SP2 and 3.5 SP1.

But it fails every time with unhelpful messages.

Great. So what to do? Well, it turns out I cannot uninstall, repair, or reinstall .NET 2.X using Windows Installer or Windows Install Cleanup. Swell.

So it gets me wondering: what uses any of these .NET runtimes? Why can't windows tell me?

Perhaps by deleting the .NET 3.5 SP1 I can wait to see what fails: Evernote 3.5 crashes ungracefully with no helpful message at all. Reinstalling it forces a reinstall of the missing .NET 3.5 SP1. But I still can't install the Security Update.

KB2416473 is a Security Update for  .NET 3.5 SP1 only - will it install now? Yes.

.NET 2.0 shows up in Add/Remove Programs, but cannot be uninstalled:





The obvious thing to do is look at the article URL (which is not clickable and can't even be selected for copy and paste... aargh.... http://support.microsoft.com/support/kb/articles/q312/5/00.asp which redirects to http://support.microsoft.com/KB/906894 but sadly this is no help. I am advised to "To resolve this problem, uninstall the .NET Framework 2.0 Service Pack 1 before you install the .NET Framework 2.0." but this is not possible on my system.

Time to try the registry? I tried to delete the values in LEGACY_CLR_OPTIMIZATION_V2.0.50727_32 but could not. So instead I searched for all .Net references and found a few to .Net 2.0 such as
 HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\ASP.NET_2.0.50727 which has Performance->Library value c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll.

So all the keys using .Net 2.0 include
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\aspnet_state\Performance
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\clr_optimization_v2.0.50727_32
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\.NET Runtime 2.0 Error Reporting
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\.NET Runtime Optimization Service
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\ASP.NET 2.0.50727.0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\SyncToy
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\System.ServiceModel.Install 3.0.0.0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\WMI.NET Provider Extension
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\System\MSDTC Gateway
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\System\MSDTC WS-AT Protocol
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\aspnet_state

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Enum\Root\LEGACY_CLR_OPTIMIZATION_V2.0.50727_32\0000
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\ASP.NET\Performance
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\ASP.NET_2.0.50727
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\aspnet_state
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\aspnet_state\Performance
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\clr_optimization_v2.0.50727_32
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\.NET Runtime 2.0 Error Reporting
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\ASP.NET 2.0.50727.0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\Business Connectivity Services(Legacy Provider)
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\idsvc
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\SyncToy
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\System.ServiceModel.Install 3.0.0.0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\System\MSDTC Gateway
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\System\MSDTC WS-AT Protocol

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Enum\Root\LEGACY_CLR_OPTIMIZATION_V2.0.50727_32\0000
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\ASP.NET\Performance
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\ASP.NET_2.0.50727
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\ASP.NET_2.0.50727\Performance
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\aspnet_state
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\aspnet_state\Performance
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\clr_optimization_v2.0.50727_32
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application\.NET Runtime 2.0 Error Reporting
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application\ASP.NET 2.0.50727.0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application\Business Connectivity Services(Legacy Provider)
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application\idsvc
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application\SyncToy
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application\System.ServiceModel.Install 3.0.0.0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\Application\WMI.NET Provider Extension
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\System\MSDTC Gateway
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\Eventlog\System\MSDTC WS-AT Protocol

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_CLR_OPTIMIZATION_V2.0.50727_32\0000
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASP.NET\Performance
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASP.NET_2.0.50727
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASP.NET_2.0.50727\Performance
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state
OK this is getting tiresome and I can see a pattern here.

In fact, 2.0 seems to be installed at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727, and likewise C:\WINDOWS\Microsoft.NET\Framework\v3.0

What Next?
Google for some other solution such as
http://blogs.msdn.com/b/astebner/archive/2005/04/16/408856.aspx