How to remove/uninstall .NET Framework 4.7 from Windows Server 2012 R2

I tried to install .NET Framework 4.7 in my test environment but some of my applications were not working properly anymore. The first step I did was to look in Programs and Features, but the “Microsoft .NET Framework 4.7” was not there. Then I searched on the Internet on how to remove it, but I couldn’t find a proper solution for my case. For non-server Windows OS, there is one, and it says that you can uninstall it from Programs and Features. But since I’m using Windows Server, that’s not applicable.

Then I started searching on my own. I clicked the “View installed updates” in Programs and Features and searched for the latest Windows update that was installed. I tried to uninstall KB3186539. Luckily, it was the .NET Framework 4.7! My applications are now working properly.

Note: If you are using a different version of Windows, the KB number might be different.

The primary reference “MySql.Data” could not be resolved because it was built against the “.NETFramework,Version=v4.5” framework. This is a higher version than the currently targeted framework “.NETFramework,Version=v4.0”.

We have a VB.NET application which was originally developed with the target framework as .NET Framework 4.5. However, because the client wants it to also run on Windows XP, we were forced it to change to .NET Framework 4. The solution is in this link. Just follow the steps on the Workaround section. I also copied the steps below to save you time from opening another page.

However, of course, if the current program requires the features that .NET Framework 4.5 offers, then you have no other choice but to re-program to support Windows XP (if the client doesn’t want to upgrade their computers and is willing to pay again to support Windows XP).


Workaround

The simplest workaround is to edit the modeling project file to ignore target framework version mismatches as follows:

1. Unload the modeling project by right clicking on it in Solution Explorer window and choosing Unload Project.

1

2. Open the project file into the editor by right clicking on it in Solution Explorer window and choosing Edit projectname.modelproj.

2

 

3. Add the following element inside the <Project> element:
<PropertyGroup>

<ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>

</PropertyGroup>

3

4. Save the project file.

5. Right click on the modeling project in Solution Explorer and choose Reload Project.

4

6. Validate your architecture in the usual way.