question

JDias-5912 avatar image
0 Votes"
JDias-5912 asked JDias-5912 commented

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

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?




windows-10-networkdotnet-runtime
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
1 Vote"
cooldadtx answered JDias-5912 commented

.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.

· 9
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@cooldadtx:

Yes, my case is similar, but with different versions of .NET Core and with no recent upgrade of Visual Studio 2019 (I think I never upgraded it...). But this case was not fully closed: no solution is provided!

The runtimes of .NET Core 3.1 are present, but this is not enough.

Do you recomend me to repair my Visual Studio 2019 installation with Visual Studio Installer? Would I lose important data to run my programs?

By the way the needed SDKs and runtimes are installed as I can see in the Settings\Applications (Windows 10 menu). I tried to repair some of them, without much result... However, such runtimes and SDKs are not accessible: they are in a different directory...

Thanks

0 Votes 0 ·

Repairing a VS installation won't remove important data but it shouldn't be necessary in this case. Just download and install the SDK directly. It should then show up again in the list. However since it is EOL you may still run into issues where tools are dropping support for 2.1.

0 Votes 0 ·

@cooldadtx:

Unfortunately, I have just installed NET Core 2.1.818 SDK and it was installed in C:\Program Files\dotnet.

The command cli dotnet has simply no access to it, as before!

The result of dotnet --list-sdks is empty!

Do you have any suggestion?

Note: this installation is now in Settings\Application as the others (which are broken as we saw...).






0 Votes 0 ·
Show more comments
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

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://docs.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--

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.