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 Filesdotnetsdk3.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 Filesdotnetsdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview-19075-0444 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.0 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview-27324-5 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview-27325-3 [C:Program FilesdotnetsharedMicrosoft.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
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. c:UsersAlirezaDocumentsTestcore3core3.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)
@Arsmn1996 Can you try installing .Net Core Build Tools as described here
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?
@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:
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?
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"
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.
@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 ?
@nguerrera Awesome, thanks for the analysis!
@akshita31 Looks like @rchande is on top of it, but the resolver in question is Microsoft.DotNet.MSBuildSdkResolver.dll described here: https://github.com/OmniSharp/omnisharp-vscode/issues/2604#issuecomment-430330103 and implemented here: https://github.com/dotnet/cli/tree/master/src/Microsoft.DotNet.MSBuildSdkResolver
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
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
@rchande This would be the same issue that causes problems for 3.0. 2.2.2xx also requires msbuild 16.
Ditto for 2.1.6xx
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
Same here, works with 2.2.105-1
Same here, works fine with 2.2.105-1
Thank you @nhactung for the suggestion
and @digital-abyss for the command to copy / paste
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
Let me know when omnisharp supports these new version :grinning:
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.
Confirmed that downgraded worked with suggestions above.
Latest OmniSharp beta as of now is
3.5.0-beta.2204which seem to work with the latest .NET Core SDK.Did this by setting
"omnisharp.path": "latest"in VS Code'ssetting.json.
This worked for me without any other workarounds or downgrading, thank you
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
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
Can confirm that with the latest omnisharp version and 2.2.203 all is working fine (ubuntu 18.04)
ubuntu 18.10
only works by downgrading sudo apt install dotnet-sdk-2.2=2.2.105-1
So when is the Marketplace getting updated with the latest release?
https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp
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
This helped me on Fedora 29, looks like it worked for other on Ubuntu: https://github.com/OmniSharp/omnisharp-roslyn/issues/1394#issuecomment-480792868
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
Omnisharp 1.19.0 is now in the VS Marketplace by updating the extension in VS Code to the latest version.
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 Filesdotnetsdk2.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
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
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!
for those interested -https://github.com/OmniSharp/omnisharp-vscode/issues/3023
I have the same problem
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
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]
@trandev Try the workaround for Snap installs outlined here https://github.com/OmniSharp/omnisharp-vscode/wiki/Troubleshooting:-'The-.NET-Core-SDK-cannot-be-located.'-errors#linux-snap-instructions
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
i updated dotnet sdk to 3.1.401 and i have the same problem
@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.
ah ok, for now i just downgrade the version of sdk to 3.1.201
thanks for your help
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?
@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.
Most helpful comment
Latest OmniSharp beta as of now is
3.5.0-beta.2204which seem to work with the latest .NET Core SDK.Did this by setting
"omnisharp.path": "latest"in VS Code'ssetting.json.