How to Uninstall .NET Framework 4.6.1

Thursday, February 11, 2016

UPDATE: Exchange Server 2013 CU13 and Exchange Server 2016 CU2 now support .NET Framework 4.6.1. Exchange 2007 and 2010 still do not. Please see my article, Exchange 2016 CU2 and Exchange 2013 CU13 now supports .NET Framework 4.6.1, for the steps required to install and support this.

You've probably heard by now NOT to install the Microsoft .NET Framework 4.6.1 on any of your Exchange servers because it's not supported. Later, the Skype for Business Team followed suit in their own article. The Exchange team even posted a handy article about it with a link to a TechNet page that explains how to temporarily block .NET Framework 4.6.1 from installing via Windows Update. That article was posted February 10, 2016 - the day after Microsoft pushed .NET Framework 4.6.1 as an important update to all computers.


My lab computers are all configured to install updates automatically, so two of my four Exchange servers had already installed the update before I realized what was happening. Good times.

So now I was faced with uninstalling the NET Framework 4.6.1 which, as it turns out, is not exactly a trivial thing. I'm documenting the process here for others who find themselves in the same predicament.

Begin by following the article, How to temporarily block the installation of the .NET Framework 4.6.1. Or if you've got several computers that you need to uninstall it from, use the REG file I created that does it for you. Simply download the BlockNetFramework461.reg file on the computer you need to fix and double-click it to configure the Registry. This will prevent the .NET Framework 4.6.1 from reinstalling once we have it removed.

Before we uninstall .NET 4.6.1, download the .NET Framework Setup Verification Utility from Microsoft employee Aaron Stebner's WebLog. We'll use this tool to confirm that .NET 4.6.1 is installed and again to confirm it's removed when we're done. Run the tool and use the drop down box to confirm that .NET Framework 4.6.1 is listed. The tool shows all the versions of .NET that are installed. Close the verification utility.



Now a word of warning: When you uninstall .NET Framework (which also removes .NET Framework 4.6, by the way), Exchange will need to recompile all of its .NET assemblies. This can take a LONG time and overload your computer's CPU. To overcome this, download the .NET Framework optimization speed up script from the .NET Blog. This script improves the performance of the mscorswv.exe process by allowing it to use multiple threads and up to 6 cores. Save the 7318.DrainNGenQueue.wsf script to the computer's desktop. We'll run it after .NET 4.6.1 is uninstalled.

Finally, you can uninstall .NET Framework 4.6.1 by going to Control Panel > Programs > Programs and Features > View Installed Updates. Search for or scroll down the list of Microsoft Windows updates to find Update for Microsoft Windows (KB3102467) and click Uninstall.


Click Yes to uninstall .NET Framework 4.6.1. After a minute or so you will be prompted to restart the computer. Click Restart Now.


Once you can log back into the computer (it will take longer than normal to get to the login screen), run the 7318.DrainNGenQueue.wsf script you saved to the desktop. The output isn't very pretty, but who cares? It will probably save you about 20 minutes while the .NET assemblies recompile.


Once the script finishes, run the .NET Framework Setup Verification Utility again to confirm that .NET Framework 4.6.1 has been removed successfully. The drop down list should now only show versions up to .NET Framework 4.5.2. This is the latest version supported by Exchange Server 2013 and 2016.



Click Verify Now to confirm that .NET Framework 4.5.2 is still configured correctly.


Congratulations! You've finally uninstalled the .NET Framework 4.6.1. You may want restart the computer again after you've uninstalled it to ensure that all services start correctly.


UPDATE #1:

A question was raised whether uninstalling .NET Framework 4.6.1 is supported by Microsoft.

Well, we know that it's not supported to install .NET Framework 4.6.1 on an Exchange or Skype for Business server, and it definitely breaks stuff. We know that uninstalling it returns it to its previous "supported" unbroken state and I don't have any errors.

Is this supported? I doubt it, but heck of a lot easier than rebuilding. Remember that "supported" = "tested" in the Microsoft world.

If you need to ensure that your Exchange and Skype for Business servers are in a "supported" state, you will have to rebuild them. Chalk it up to a lesson in never trusting automation.


UPDATE #2:

I spoke with the Exchange product team today and they recommend reinstalling the .NET Framework 4.5.2 again (run Repair) after uninstalling .NET 4.6.1 and restarting the computer.


This may cause Exchange to recompile the .NET assemblies again. Remember to run the 7318.DrainNGenQueue.wsf script to reduce the time it takes to recompile. If the script shows that everything is up-to-date, then you're done.


If Exchange does need to recompile you should reboot again after the script completes.