GuiMendel
GuiMendel

Reputation: 719

Can't install older version of .NET

The problem:

I have a project in Unity, and am coding in Visual Studio Code. In order to use the VSCode "C#" extension, I need .NETFramework version 4.7.1. Here's the error message the extension throws if I don't have it:

Failed to load project file 'c:\Desenvolvimento\Projetos\Emergent-RPG-Prototype\Assembly-CSharp.csproj'.
c:\Desenvolvimento\Projetos\Emergent-RPG-Prototype\Assembly-CSharp.csproj
c:\Users\Gui Mendel\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.38.1-beta.15\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1217,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

Problem is, I accidentally installed version 4.8, which doesn't satisfy the extension. The same installer for version 4.8 allows me to uninstall it, which I did, but for some reason, when I now try to install version 4.7.1, I get the following error:

.NET Framework 4.7.1 or a later update is already installed on this computer.

It says I can find more information about blocked installations here, but this page annoyingly states no action necessary in my case scenario (which isn't the case as this problem keeps me from installing the version I need).

What I've tried:

I tried this page's advice on uninstalling the sdk for good, but it doesn't show up as installed in any of the provided methods. I think it really is uninstalled, but somehow the 4.7.1 installer believes otherwise.

In this page though, I found out there seems to be a registry key which holds what sdk version is installed. And in fact, there I found it, a key stating I have version 4.8 installed. I completely removed the NET Framework subkey, rebooted, but the problem still persisted. I haven't restored it, but in case I need to, I do have it backed up.

Question:

What do I have to do to be able to install version 4.7.1?

Please let me know if any necessary information is missing, I've posted all I could think of.

Additional Info

Upvotes: 1

Views: 966

Answers (1)

GuiMendel
GuiMendel

Reputation: 719

Alright, turns out I solved my own problem while researching for this question. Posting it here in case anyone runs into a similar issue.

The Solution

Head to the 4.7.1 version download page (or a later version if you need to). You might be tempted to download it with the Developer Pack button on the right, but don't - you'd run into the same problem:

screen shot of wrong download link

Don't download this one

Instead, head down to Advanced downloads and pick the "Offline Installer" Developer Pack:

enter image description here

Download this one instead

It's a rather simple solution, but it could render you sleepless if you didn't look for it in the right place.

Hope this helps someone in the future!

Upvotes: 1

Related Questions