1

enter image description hereenter image description hereIt seems I cannot do any .NET standard 2.0 based projects after a clean install.

I am on the latest version of the .NET Framework 4.7.2, VS 2017 - 15.9.3 and .NET Core 2.2.1

I have installed both the x64/x86 versions of the .NET 2.2 SDK

Attached is my setup info,

EDIT: Actual error when opening a solution with a .NET Standard 2.0 project inside it

The current .NET SDK does not support targeting .NET Standard 2.0.  Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0. 
Microsoft.Extensions.HealthChecks.SqlServer 
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets    126 

EDIT2 Seems like my question confused people that answered, my specific issue is to do with some how .NET Standard 2.0 missing from my machine and nothing to do with an error a project is throwing (its throwing the error because of missing framework)

I will post a new question about this as this got focused on a specific project in my solution vs the actual error.

EDIT 3 More focused question on the actual problem Missing .NET Standard 2.0 Framework with latest .NET Core SDK 2.2.1, .NET Framework 4.7.2, VS2017 15.9.3

closing this one

Zoinky
  • 4,083
  • 11
  • 40
  • 78
  • Are you able to build via the command line? `dotnet build {pathtocsproj}` ? – Matthew Dec 10 '18 at 15:46
  • The error is thrown by a *non*-Microsoft extension with a fake `Microsoft` prefix – Panagiotis Kanavos Dec 10 '18 at 15:47
  • Closing this, see edit3 – Zoinky Dec 10 '18 at 16:13
  • @Panagiotis Kanavos: no, it isn't. Nothing to do with it. I also had to reinstall a computer right now because of a hardware failure. I didn't have any problem with my previous installation, VS installed a long time ago, upgraded all along. *But if you install a VS now, with the current installer, there will be no Standard 2.0.* – Gábor Dec 28 '18 at 00:04

1 Answers1

0

If you format the error you'll see it's thrown by the Microsoft.Extensions.HealthChecks.SqlServer extension which hasn't been updated for a year and doesn't look like a Microsoft extension either - it's published by a user named seven who published a bunch of packages with Microsoft prefixes about a year ago and then went silent.

I'd strongly suggest removing that extension. You could make it work if you installed the .NET Core runtime it needs but I wouldn't trust something that doesn't even have a link to its project page

Update

Checking the package's dependencies shows it depends on an abandoned package by the same user. The source link points to a fork of the experimental HealthChecks repository that was never released.

As the original link shows, those analyzers were replaced by the classes in the Microsoft.AspNetCore.Diagnostics and eventually released as the official Microsoft.AspNetCore.Diagnostics.HealthChecks package, that does support .NET Standard 2.0

Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236
  • Problem is not even this project, when i create a brand new project and want to target .NET Standard 2.0, its not even in the list, see the attached image that shows available .net standard frameworks but no 2.0 – Zoinky Dec 10 '18 at 15:51
  • @Zoinky the problem is the fake package. That's what the error shows, in the error message. The image doesn't matter. The *error message* quite clearly complains about `Microsoft.Extensions.HealthChecks.SqlServer` – Panagiotis Kanavos Dec 10 '18 at 15:55
  • I think i am not doing a good job at explaining myself. .NET Standard 2.0 is completely missing when i try to target a BRAND new project to it 1. created a class library 2. pointed to .net standard (which it picked 1.6) 3. went to project settings to change it to 2.0, there is no 2.0 in the list, same as the latest image i attached, see all attached images – Zoinky Dec 10 '18 at 15:57
  • @Zoinky Visual Studio doesn't behave like that. I'm using those versions for quite some time already. *Fake* extensions though are a problem. I don't know how you installed VS and the SDK, but I do know that your error message shows a fake package – Panagiotis Kanavos Dec 10 '18 at 15:59
  • that is one of 20 errors in the solution, all complaining about the same thing that .net standard 2.0 is missing from my machine. FYI, i downloaded this https://github.com/dotnet-architecture/eShopOnContainers and thats where all errors are coming from but looking deeper into this, it has the to do with .NET Standard 2.0 missing and nothing to do with specific projects – Zoinky Dec 10 '18 at 15:59
  • Please ignore that specific error for that specific project, and see the last image i attached (at the top of the thread) that shows that .NET Standard 2.0 is missing from my machine even though i have the latest .NET Core SDK (2.2.1) as well as the latest Full .NET Framework (4.7.2) – Zoinky Dec 10 '18 at 16:03
  • @Zoinky in Visual Studio Installer, did you select the `.NET Core 2.1 development tools` and `.NET Core 2.1 development tools` in the `.NET Desktop Development` or `.NET Core cross-platform development` payload? – Panagiotis Kanavos Dec 10 '18 at 16:13
  • I moved the q to be more specific https://stackoverflow.com/questions/53709476/missing-net-standard-2-0-framework-with-latest-net-core-sdk-2-2-1-net-framew Also yes from the attached image you will see that i selected all the right things in vs installer – Zoinky Dec 10 '18 at 16:18