Solvedomnisharp vscode The SDK 'Microsoft.NET.Sdk.Web' specified could not be found

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview-010184
Commit: c57bde4593

Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview-010184\

Host (useful for support):
Version: 3.0.0-preview-27324-5
Commit: 63a01b08e5

.NET Core SDKs installed:
3.0.100-preview-010184 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview-19075-0444 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview-27324-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview-27325-3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

VS Code version:

Version: 1.31.1 (user setup)
Commit: 1b8e8302e405050205e69b59abb3559592bb9e60
Date: 2019-02-12T02:20:54.427Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

C# Extension version:

1.18.0-beta7

Steps to reproduce

  1. Install latest dotnet core version: 3.0.100-preview-010184
  2. Install latest C# extension release: 1.18.0-beta7
  3. Create new dotnet webapi project
  4. Launch VSCode

Output

Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. c:\Users\Alireza\Documents\Test\core3\core3.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, Boolean throwOnFileNotExistsError)
at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) at Microsoft.Build.Evaluation.Evaluator4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion) at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath) at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath) at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectLoader loader) at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader)

46 Answers

✔️Accepted Answer

Latest OmniSharp beta as of now is 3.5.0-beta.2204 which seem to work with the latest .NET Core SDK.

Did this by setting "omnisharp.path": "latest" in VS Code's setting.json.

Other Answers:

I confirm that the SDK version 2.2.202 has conflict with OmniSharp, tried to install Mono, set the environment variables,.. but no result.
Switch back to the 2.2.105 everything is fine. So far so good, linting and intellisense are back, I hope to wait for an update or at least a solution.

I had this same problem with dotnet 2.1.602 -- downgrading to 2.1.500 worked for me as well. Thanks @nhactung for the suggestion!

For those on linux mint or ubuntu:
sudo apt-get install dotnet-sdk-2.1=2.1.500-1

confirm that pinning dotnet core version to 2.2.105 fixes the issue.

sudo apt-get install dotnet-sdk-2.2=2.2.105-1

Many thanks for the suggestion to downgrade.

sudo apt-get install dotnet-sdk-2.2=2.2.105-1

Worked me for as well on Linux Mint 19.1

More Issues: