The .NET Core SDK is not installed or cannot be fo

2019-03-12 00:16发布

问题:

When compiling .Net Core RC2 project under VS 2015 I am receiving following error

GETSDKTOOLINGINFO : error : The .NET Core SDK is not installed or cannot be found under the path C:\Program Files\dotnet\bin. These components are required to build and run this project.

Files do exist under that directory.

Also when I input dotnet into command line I do see it's prining proper version number and stuff.(.NET Command Line Tools (1.0.0-beta-001598)

Any idea how to resolve the issue?

回答1:

  1. Remove all older versions of core
  2. Unistall Microsoft .NET CLI for Windows from control panel if it exists. This helped me.

After you install RC2, Make sure your control panel shows ONLY these for .Net Core

  • Microsoft .Net Core 1.0.0 RC2 - VS 2015 Tooling Preview 1 (1.0.20513.14)
  • Microsoft .Net Core 1.0.0 RC2 - SDK Preview 1 (x64) to be version 1.0.0.2702

Hope this helps.



回答2:

If you install VS 2015 and VS 2017 side by side you may end up with a situation where you have: .NET Core 2015 x86 .NET Core 2017 x64 (Take a look in Control Panel > Programs and Features)

When you try to open a VS project/solution targeting .NET Core you get the error message described in this posting.

If you search on this error you may get taken to this page: https://github.com/aspnet/Tooling/blob/master/known-issues-vs2015.md#missing-sdk

But the solutions described there don't work (such as editing your PATH to exclude the x64 version.)

HOWEVER .. from that page, download the x86 version of .NET x86 ".NET Core 1.0.1 SDK 1.0.0-preview2-003131 download links"

CLOSE any open sessions of VS. Then uninstall .NET Core 2017 x64 and then install .NET Core x86 version you just downloaded.

Your Control Panel > Programs and Features should now look like this:

Control Panel - After

What this effectively does is that now all your .NET Core is x86 rather than a mix of x86 and x64.

Reboot not required.



回答3:

Repair Microsoft .Net Core 1.0.0 RC2

In case the previous answer doesn't help you because the right version of dotnet core (SDK & Tools) is already the only one installed (I was in that case):

Repair both and that should fix your problem.



回答4:

For anyone getting similar messages, here is the official Issue page in the CLI repo.

Of the mentioned workarounds, one is to remove the 'DotNet CLI' entries from the installed programs.



回答5:

This is a rolling issue, not sure why VS updates dont offer the option to check install.

The issue is know by MS now, like @orad mentioned above once the previous versions have been uninstalled

Then install this based on the correct release version and target platform