.NETCore 2.1 - Target framework disappeared (Windows Update?)

JDias 71 Reputation points
2022-04-27T13:13:02.693+00:00

I developed some of my apps in Visual Studio 2019 and with the framework .NET Core 2.1, without major problems. (C#, ASP.NET Core MVC).

However, since a few days ago, I can't open my projects: the framework is missing.

Doing dotnet --list-sdks, it returns an empty list.

In the directory Program Files (x86)\dotnet , there are some file of framework 3.1. It seems that dotnet sees this directory.

In the directory Program Files\dotnet, there are some frameworks (1, 2.1, 3.1). dotnet doesn't see this directory.

What can I do?

Could it be the last update (Windows Update) of the .NET Framework?

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,271 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 47,966 Reputation points
    2022-04-27T14:20:05.547+00:00

    .NET Core 2.1 was end of life Aug of last year. While the runtime won't get uninstalled automatically, updates to tooling won't be necessarily looking for it anymore.

    .NET Framework is independent of .NET Core and installing/updating/removing one doesn't impact the other. 2.1 still shows up in mine and I'm running 6.0.300-preview.22204.3. You can try running dotnet --list-runtimes and confirm the runtime is still installed, which it should be.

    I'm wondering if you are a victim of this reported issue. You should be able to reinstall the .NET Core 2.1 SDK manually to get back to where you were.

    1 person found this answer helpful.

  2. Limitless Technology 39,351 Reputation points
    2022-04-28T15:58:02.937+00:00

    Hello JDias,

    Yes, it is highly possible that you have pinned the SDK target version in a global.json file and therefor the project can't find the version after the update.

    The next link will show you how is usually the syntax so you can find it in the global.json file:

    https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version

    Hope this helps with your query,

    -----------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments