vscode-csharp: 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
- Install latest dotnet core version: 3.0.100-preview-010184
- Install latest C# extension release: 1.18.0-beta7
- Create new dotnet webapi project
- 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.Evaluator
4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List
1& projects, Boolean throwOnFileNotExistsError) at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator
4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) at Microsoft.Build.Evaluation.Evaluator
4.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, IDictionary
2 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, Func
1 loader)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 45 (7 by maintainers)
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’ssetting.json
.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
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.
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
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
This worked for me without any other workarounds or downgrading, thank you
Same here, works with 2.2.105-1
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
I have the same problem
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.
@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.
@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.
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!
Omnisharp 1.19.0 is now in the VS Marketplace by updating the extension in VS Code to the latest version.
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
Can confirm that with the latest omnisharp version and 2.2.203 all is working fine (ubuntu 18.04)
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"
@Arsmn1996 Can you try installing .Net Core Build Tools as described here