Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade Visual Studio to use .NET SDK 8 again?

I have Visual Studio 2022 installed with and without preview, but it seems they all use .NET SDK 9.0 since I upgraded. This turned out to be a terrible decision as since it keeps using old versions of nuget packages. I tried modifying the installation to remove the SDK or also the runtime. But removing the runtime deletes essential Visual studio features.

.NET SDK 8 is not listed in the individual components. Even though I have it installed outside of VS, apparently that's not good enough.

Having uninstalled .NET SDK 9 with VS, it's no longer listed as an installed program in Windows.

like image 698
MrFox Avatar asked Jan 18 '26 08:01

MrFox


1 Answers

Try this:

Check that 8.0.xxx version is installed on your pc (add or remove programs, filter by sdk):

enter image description here

if it's not installed, install one from https://dotnet.microsoft.com/en-us/download/visual-studio-sdks

after that go to solution folder and create a global.json file with contents like (version should be of SDK you installed):

{
  "sdk": {
    "version": "8.0.313"
  }
}

more on global.json https://learn.microsoft.com/en-us/dotnet/core/tools/global-json

like image 150
Ryhor Gunko Avatar answered Jan 20 '26 23:01

Ryhor Gunko