Print Page | Close Window

Error NETSDK1045: Does Not Recognize .NET Core 2.2

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=31731
Printed Date: 25 June 2022 at 1:54am
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: Error NETSDK1045: Does Not Recognize .NET Core 2.2
Posted By: code1ca
Subject: Error NETSDK1045: Does Not Recognize .NET Core 2.2
Date Posted: 26 December 2021 at 3:16pm
Hello All,

Wondering why my system is giving me the message: "Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 2.2 ... use a version of the .NET SDK that supports .NET Core 2.2"

I put line numbers below for ease in illustrating where I'm coming from. From what I can tell based on the Package Manager Console (see line numbers 19, 23, 25 and 28 below) I have .NET Core 2.2, 
am I correct? If I already have .NET Core 2.2, then I wonder what am I missing that is preventing a successful program run?

To make sure I am not missing any detail in showing what I am seeing, I have uploaded the full tester solution to github shown in the link:

https://github.com/vlmbts/MVCcoreExploreCalifornia/commit/5ef856d8e497518553f641ad9df50a9c2b2db044

If I uninstall then reinstall things in a trial and error fashion hoping that somehow it can get fixed, I can actually do more harm than good, so I do not wish to pretend having significant experience 
installing Visual Studio and .NET Core 2.2; instead I'd like to ask the guidance of experts here who have more experience than I do in this area.
1 From Error List Window:
2 Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 2.2.  Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2.
3
4 From Package Manager Console:
5
6 PM> dotnet --info
7 .NET SDK (reflecting any global.json):
8 Version:   6.0.101
9 Runtime Environment:
10 OS Name:     Windows
11 OS Version:  6.3.9600
12 OS Platform: Windows
13 RID:         win81-x64
14 Base Path:   C:\Program Files\dotnet\sdk\6.0.101\
15 Host (useful for support):
16   Version: 6.0.1
17 .NET SDKs installed:
18   2.1.526 [C:\Program Files\dotnet\sdk]
19   2.2.207 [C:\Program Files\dotnet\sdk]
20   6.0.101 [C:\Program Files\dotnet\sdk]
21 .NET runtimes installed:
22   Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
23   Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
24   Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
25   Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
26   Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
27   Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
28   Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
29   Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
30   Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.05 - http://www.webwizforums.com
Copyright ©2001-2022 Web Wiz Ltd. - https://www.webwiz.net