Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SDK 'Microsoft.NET.Sdk.Web' specified could not be found #2876

Closed
arsmn opened this issue Feb 27, 2019 · 45 comments
Closed

The SDK 'Microsoft.NET.Sdk.Web' specified could not be found #2876

arsmn opened this issue Feb 27, 2019 · 45 comments
Assignees
Labels
MSBuild .Net sdk not found These are a group of issues when the dotnet sdk could not be found OmniSharp

Comments

@arsmn
Copy link

arsmn commented Feb 27, 2019

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)

@akshita31 akshita31 added the .Net sdk not found These are a group of issues when the dotnet sdk could not be found label Feb 27, 2019
@akshita31
Copy link
Contributor

@Arsmn1996 Can you try installing .Net Core Build Tools as described here

@safern
Copy link
Member

safern commented Mar 1, 2019

This is happening to me as well with 3.0 preview2 .NET Core SDK for OSX...

Searching SDK directory in [/usr/local/share/dotnet]
--- Resolving SDK version from SDK dir [/usr/local/share/dotnet/sdk]
Considering version... [2.0.0-preview1-005685]
Considering version... [2.0.0-preview2-006497]
Considering version... [2.1.302]
Considering version... [3.0.100-preview-010184]
Considering version... [NuGetFallbackFolder]
Checking if resolved SDK dir [/usr/local/share/dotnet/sdk/3.0.100-preview-010184] exists
Resolved SDK dir is [/usr/local/share/dotnet/sdk/3.0.100-preview-010184]
Found CLI SDK in: /usr/local/share/dotnet/sdk/3.0.100-preview-010184
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/Users/santifdezm/repos/ApplyNullableFromJetBrains/ApplyNullableFromJetBrains.csproj'.
/Users/santifdezm/repos/ApplyNullableFromJetBrains/ApplyNullableFromJetBrains.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found.  /Users/santifdezm/repos/ApplyNullableFromJetBrains/ApplyNullableFromJetBrains.csproj
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, System.Boolean throwOnFileNotExistsError) [0x00254] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00024] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x00103] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.Execution.ProjectInstance projectInstanceIfAnyForDebuggerOnly, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0001a] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0004c] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00034] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00023] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00126] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0009e] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f5] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 
  at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <46c04c65986d41159ea03c6835eb767f>:0 
  at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <46c04c65986d41159ea03c6835eb767f>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <46c04c65986d41159ea03c6835eb767f>:0 
  at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass25_0.<LoadProject>b__0 () [0x00000] in <46c04c65986d41159ea03c6835eb767f>:0 
  at (wrapper delegate-invoke) System.Func`1[System.ValueTuple`3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray`1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic],OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs]].invoke_TResult()
  at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func`1[TResult] loader) [0x0001b] in <46c04c65986d41159ea03c6835eb767f>:0 

dotnet info output:

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

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.0.100-preview-010184/

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

.NET Core SDKs installed:
  2.0.0-preview1-005685 [/usr/local/share/dotnet/sdk]
  2.0.0-preview2-006497 [/usr/local/share/dotnet/sdk]
  2.1.302 [/usr/local/share/dotnet/sdk]
  3.0.100-preview-010184 [/usr/local/share/dotnet/sdk]

However if I uninstall it and use the 2.1 SDK that I have installed works fine.

cc: @rainersigwald @DustinCampbell @nguerrera is this a SDK/CLI issue?

@nguerrera
Copy link

nguerrera commented Mar 1, 2019

@safern Thank you for that log!

We can see hostfxr picking the 3.0 SDK and then the resolver rejects it.

This is what I think is happening:

  1. $(MSBuildVersion) is < 16.0
  2. The SDK resolver dll being used is older than the version in VS 15.9+ that can pick the "latest compatible"
  3. The older resolver is rejecting 3.0 SDK returned by hostfxr because it has a minimumMSBuildVersion of 16.0
  4. MSBuild throws InvalidProjectFileException without printing the resolver error that would have been something like "Can't use 3.0 SDK because it needs MSBuild 16 and this is

I don't know the exact details on what determines which MSBuild and resolver that is used by Omnisharp. I think it probes for mono but also includes its own as a fallback? @rchande @DustinCampbell can you confirm?

@safern
Copy link
Member

safern commented Mar 1, 2019

To confirm a piece of your theory, indeed MSBuild version that comes with Omnisharp is 15.0:
Located 1 MSBuild instance(s) 1: StandAlone 15.0 - "/Users/santifdezm/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin"

@nguerrera
Copy link

At a minimum we need to put a 15.9+ resolver there. This would make 2.1.302 be used in repro above as it is latest compatible.

But we also need a path to msbuild 16 in omnisharp so folks can actually use 3.0.

These should probably be tracked as separate issues.

@akshita31
Copy link
Contributor

@nguerrera I am not very clear on the resolver you are talking about here. Can you please eleborate on what are the changes that are needed in omnisharp ?

@rchande
Copy link

rchande commented Mar 5, 2019

@nguerrera Awesome, thanks for the analysis!

@rchande rchande self-assigned this Mar 5, 2019
@nguerrera
Copy link

@akshita31 Looks like @rchande is on top of it, but the resolver in question is Microsoft.DotNet.MSBuildSdkResolver.dll described here: #2604 (comment) and implemented here: https://github.com/dotnet/cli/tree/master/src/Microsoft.DotNet.MSBuildSdkResolver

@tungp99
Copy link

tungp99 commented Apr 6, 2019

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.

@digital-abyss
Copy link

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

@Dev-Owl
Copy link

Dev-Owl commented Apr 7, 2019

I can confirm on my ubuntu 18.04 that version 2.2.202 causes issues with OmniSharp a downgrade to 2.2.105 "fixed" it so far.
Does anybody has more information what happened, did I miss an update somewhere ?

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

@nguerrera
Copy link

@rchande This would be the same issue that causes problems for 3.0. 2.2.2xx also requires msbuild 16.

@nguerrera
Copy link

Ditto for 2.1.6xx

@sada-kubsad
Copy link

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

@matthijsbreemans
Copy link

Same here, works with 2.2.105-1

@frederic-prusse
Copy link

Same here, works fine with 2.2.105-1

Thank you @nhactung for the suggestion
and @digital-abyss for the command to copy / paste

@sprudel79
Copy link

sprudel79 commented Apr 9, 2019

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

@ambs
Copy link

ambs commented Apr 9, 2019

Let me know when omnisharp supports these new version 😀

@anarsen
Copy link

anarsen commented Apr 11, 2019

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.

@hashharvest
Copy link

Confirmed that downgraded worked with suggestions above.

@ghost
Copy link

ghost commented Apr 11, 2019

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.

This worked for me without any other workarounds or downgrading, thank you

@cycprime
Copy link

Many thanks for @nhactung for the suggestion and @digital-abyss for the command.

Confirmed that the following worked on Ubuntu 18.04 LTS:

sudo apt-get install dotnet-sdk-2.1=2.1.500-1

@sprudel79
Copy link

Thanks @anarsen
Using the latest omnisharp seems to work (right now 3.5.0-beta.2210).
I am using dotnet-sdk-2.2.203 btw

@Dev-Owl
Copy link

Dev-Owl commented Apr 12, 2019

Can confirm that with the latest omnisharp version and 2.2.203 all is working fine (ubuntu 18.04)

@lonix1
Copy link

lonix1 commented Apr 13, 2019

ubuntu 18.10
only works by downgrading sudo apt install dotnet-sdk-2.2=2.2.105-1

@vanillajonathan
Copy link

So when is the Marketplace getting updated with the latest release?
https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp

@rohitrishi
Copy link

rohitrishi commented Apr 14, 2019

Hello,

I have the same issue and have following installed:

.NET Core SDK :  2.2.203
VS Code: 1.33.1(user setup)
C# extension(omnisharp-vscode): 1.18.0
OS: Windows 10

I understand from the comments above the latest vs-code C# extension(1.18.1??) should fix the issue. Was just wondering what is the ETA on it's release to VS-Code marketplace.

NOTE: Adding "omnisharp.path": "latest" to the workspace settings in vscode does help get around this problem for now.

Thanks

@kjbetz
Copy link

kjbetz commented Apr 16, 2019

This helped me on Fedora 29, looks like it worked for other on Ubuntu: OmniSharp/omnisharp-roslyn#1394 (comment)

@arsmn
Copy link
Author

arsmn commented Apr 16, 2019

I solved it by installing .Net Core Build Tools on Windows.
On Arch Linux I add this line to .bashrc (or .zshrc) file:
export MSBuildSDKsPath=$HOME/dotnet/sdk/$(dotnet --version)/Sdks

@vanillajonathan
Copy link

Omnisharp 1.19.0 is now in the VS Marketplace by updating the extension in VS Code to the latest version.

@tonyranieri
Copy link

I'm having this issue with Omnisharp 1.19.0 (ms-vscode.csharp-1.19.0)

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.203\

Host (useful for support):
Version: 2.2.4
Commit: f95848e524

If I pin my .NET core version to 2.2.104 it works fine, but when it tries to use 2.2.203 I get the "Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found." error

@as3mbus
Copy link

as3mbus commented Apr 24, 2019

assuming you already installed latest version and installed another version of dotnet you can specify sdk used in project through adding global.json

{
  "sdk": {
    "version": "2.0.0" 
  }
}

change version value to version omnisharp work with.
afaik it works with 2.2.106, yet still having problem with 2.2.203

have added "omnisharp.path": "latest", in VS Code's setting.json and it still fails nonetheless

OmniSharp server started.
    Path: C:\Users\User.vscode\extensions\ms-vscode.csharp-1.19.0\.omnisharp\1.32.19-beta.25\OmniSharp.exe
    PID: 6520

i ended up to stick with 2.2.1 version for the time being

@rchande
Copy link

rchande commented Apr 25, 2019

I believe the original issue in this bug is fixed with 1.19.0 so I'm going to close this.
@wessiyad please file a new issue and include your log. Thanks!

@tonyranieri
Copy link

for those interested -#3023

@korolevsa
Copy link

I have the same problem

@mishrsud
Copy link

mishrsud commented Mar 2, 2020

As explained in my answer here: https://stackoverflow.com/a/60482521/190476 you could get this error in VS 2019 as well when you're missing the ".NET Core cross-platform development" workload

@thotran90
Copy link

I got the same issue in Ubuntu 20.04 and dotnet 3.1.
.NET Core SDK (reflecting any global.json):
Version: 3.1.201
Commit: b1768b4ae7

Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: linux-x64
Base Path: /snap/dotnet-sdk/69/sdk/3.1.201/

Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8

.NET Core SDKs installed:
3.1.201 [/snap/dotnet-sdk/69/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.3 [/snap/dotnet-sdk/69/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.3 [/snap/dotnet-sdk/69/shared/Microsoft.NETCore.App]

@JoeRobich
Copy link
Member

@thotran90
Copy link

I found that the issue came from installing dotnet-sdk via snap. I tried to uninstall dotnet-sdk and re-install via apt install. Then I need to update DOTNET_ROOT.
The issue is solved.

Thanks @JoeRobich

@liodali
Copy link

liodali commented Aug 13, 2020

i updated dotnet sdk to 3.1.401 and i have the same problem

@JoeRobich
Copy link
Member

@liodali The latest pre-release 1.23.0 build - https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.0 - has better support for the new SDKs. If you are on a Mono platform be sure to use the included version of Mono by setting "useGlobalMono" to "never" otherwise it will use your system install of Mono which may still be incompatible.

@liodali
Copy link

liodali commented Aug 13, 2020

ah ok, for now i just downgrade the version of sdk to 3.1.201
thanks for your help

@dsimanis
Copy link

dsimanis commented Oct 5, 2020

I'm at SDK: 3.1.402, MSBuild: 16.8.0, omniSharp 1.23.2. I am not using global mono and yet having the same problem. I realize that the issue has been closed. Where would I look for the right solution in my case?

@JoeRobich
Copy link
Member

@dsimanis Sorry you are running into issues. Please open a new issue and provide your OmniSharp Log and other information. Your situation may be different than others and we can only really know when we have that information.

@pnellesen
Copy link

pnellesen commented Mar 18, 2021

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

This worked for me without any other workarounds or downgrading, thank you

Although this is old, just wanted to comment that this also worked for me, in case anyone else finds this like I did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MSBuild .Net sdk not found These are a group of issues when the dotnet sdk could not be found OmniSharp
Projects
None yet
Development

No branches or pull requests