I am trying to solve this below omnisharp issue last 3 days. But not solve yet
I followed many solution but anything is not work for me.
Below I mentioned what I did as this link https://www.py4u.net/discuss/1941159
I did reinstall vs code, extensions, downgrade extensions.
Added a global.json, changed setting.json as below mentioned.
exported into ~/.bashrc file. as below mentioned And
- I have install mono and I addd into setting.json this line
"omnisharp.useGlobalMono": "always",
. But got another warn in Omnisharp log as[warn]: OmniSharp.CompositionHostBuilder It looks like you have Mono installed which contains a MSBuild lower than 16.7.0 which is the minimum supported by the configured .NET Core Sdk.
Then I add "msbuild": { "useBundledOnly": true }, into ominsharp.json. The above mentioned warning has gone. But Still fail]: OmniSharp.MSBuild.ProjectLoader The SDK 'Microsoft.NET.Sdk' specified could not be found.
Ubuntu : 20.04 , vs code version : 1.63.2
which dotnet
output:
/usr/bin/dotnet
$ dotnet --info
output:
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
3.1.416 [/usr/share/dotnet/sdk]
5.0.100 [/usr/share/dotnet/sdk]
5.0.209 [/usr/share/dotnet/sdk]
5.0.404 [/usr/share/dotnet/sdk]
6.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.22 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.22 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
$ xdg-open ~/.bashrc output:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export DOTNET_ROOT=/snap/dotnet-sdk/current
export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current
export MSBuildSDKsPath =/usr/share/dotnet/sdk/6.0.101/Sdks
export PATH=$PATH:$HOME/.dotnet
omnisharp.json
{ "msbuild": { "useBundledOnly": true }, "UseLegacySdkResolver": true }
global.json
{
"sdk": {
"version": "6.0.101",
"rollForward": "latestMinor"
}
}
setting.json
{
"omnisharp.path": "latest",
"omnisharp.useGlobalMono": "never",
"omnisharp.projectLoadTimeout": 600
}
OmniSharp Log:
Starting OmniSharp server at 01/01/2022, 23:33:28
Target: /home/travel-techne-bo-for-ota/TechneTravel.sln
OmniSharp server started with Mono 6.12.0.
Path: /home/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.37.18-beta.120/omnisharp/OmniSharp.exe
PID: 10445
Starting OmniSharp on ubuntu 20.4 (x64)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Because 'UseBundledOnly' is enabled in the configuration, OmniSharp will only use the bundled MSBuild.
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 17.0.0 - "/home/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.37.18-beta.120/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.37.18-beta.120/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 17.0.0 - "/home/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.37.18-beta.120/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.37.18-beta.120/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.37.18-beta.120/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.37.18-beta.120/omnisharp/.msbuild
info: OmniSharp.WorkspaceInitializer
////// removed some for short
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/travel-techne-bo-for-ota/src/Domain/Domain.csproj
A compatible installed .NET SDK for global.json version [6.0.101] from [/home/travel-techne-bo-for-ota/global.json] was not found.
Install the [6.0.101] .NET SDK or update [/home/travel-techne-bo-for-ota/global.json] with an installed .NET SDK:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
[fail]: OmniSharp.MSBuild.ProjectLoader
Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
[fail]: OmniSharp.MSBuild.ProjectLoader
The SDK 'Microsoft.NET.Sdk' specified could not be found.
[fail]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/travel-techne-bo-for-ota/src/Domain/Domain.csproj'.
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/travel-techne-bo-for-ota/src/Domain/Domain.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/travel-techne-bo-for-ota/src/Application/Application.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/travel-techne-bo-for-ota/src/Infrastructure/Infrastructure.csproj
and I remove some line in this log, I created an issue on GitHub https://github.com/OmniSharp/omnisharp-vscode/issues/4985. You can see the Full omnisharp Log in this link
Please help to solve this issue. I had tried to solve last few days. Please help me