Open cordsac opened 5 years ago
I am also seeing this issue.
I am also seeing this issue.
Did you find any solution? if yes please post on here. VS code not showing intellisense /suggestion. I think this was the reason for it? do you have that problem too?
I'm also getting this. It seems to be related to .NET Core being updated to 2.2.202.
.NET Core SDK (reflecting any global.json):
Version: 2.2.202
Commit: 8a7ff6789d
Runtime Environment:
OS Name: ubuntu
OS Version: 18.10
OS Platform: Linux
RID: ubuntu.18.10-x64
Base Path: /usr/share/dotnet/sdk/2.2.202/
Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6
.NET Core SDKs installed:
2.2.202 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
This looks like it might be a duplicate of #2965.
I'm also getting this. It seems to be related to .NET Core being updated to 2.2.202.
ya, I got the point, the reason was the latest update (2.2.202.) So I downgrade .Net core to 2.1.202 and now problem solved
I'm also getting this. It seems to be related to .NET Core being updated to 2.2.202.
ya, I got the point, the reason was the latest update (2.2.202.) So I downgrade .Net core to 2.1.202 and now problem solved
I also got this problem, I try to downgrade the .Net core to 2.1.602 and have uninstalled the visual studio code many times,but the omniSharp cache always in there ,so everytime I reinstall the visual studio code,the omniSharp not reinstall,So the problem still in there
.NET Core SDK(reflecting any global.json):
Version: 2.1.602
Commit: 04475eb7cf
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.602\
Host (useful for support):
Version: 2.1.9
Commit: dcedc87d22
.NET Core SDKs installed:
2.1.602 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I'm also getting this. It seems to be related to .NET Core being updated to 2.2.202.
ya, I got the point, the reason was the latest update (2.2.202.) So I downgrade .Net core to 2.1.202 and now problem solved
I also got this problem, I try to downgrade the .Net core to 2.1.602 and have uninstalled the visual studio code many times,but the omniSharp cache always in there ,so everytime I reinstall the visual studio code,the omniSharp not reinstall,So the problem still in there
.NET Core SDK(reflecting any global.json): Version: 2.1.602 Commit: 04475eb7cf Runtime Environment: OS Name: Windows OS Version: 10.0.17134 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.602\ Host (useful for support): Version: 2.1.9 Commit: dcedc87d22 .NET Core SDKs installed: 2.1.602 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
well,I figured out where the omnisharp cache is,So I reinstalled the fk little software,finally I found the reason is the slow speed of downloading the omnisharp ,haha,anyway thank u everyone
As a quick workaround, you can also set the MSBuildSDKsPath environment variable and point to Sdks location.
On Linux (Ubuntu 18.04 in my case) I added following to my .bashrc
export MSBuildSDKsPath ="/usr/share/dotnet/sdk/2.2.202/Sdks"
On Windows Edit System Environment Variables and add a system variable MSBuildSDKsPath and set to C:\Program Files\dotnet\sdk\2.2.202\Sdks
As a quick workaround, you can also set the MSBuildSDKsPath environment variable and point to Sdks location.
On Linux (Ubuntu 18.04 in my case) I added following to my .bashrc
export MSBuildSDKsPath ="/usr/share/dotnet/sdk/2.2.202/Sdks"
On Windows Edit System Environment Variables and add a system variable MSBuildSDKsPath and set to C:\Program Files\dotnet\sdk\2.2.202\Sdks
yeah,thank u ,my system is windows10 , I choosed the default install location,I checked the selection in process of install which reminded me to inject the path,my problem have been solved,thank u again :)
I'm also having this problem on Ubuntu 18.04 LTS. It just recently started.
I also have this problem on Ubuntu 18.04 LTS, and this worked for me:
$ export MSBuildSDKsPath="/usr/share/dotnet/sdk/2.1.603/Sdks/"
$ code .
Hi all, we recently changed the version of mono that ships with omnisharp to hopefully improve this. Can you give it a try by setting "omnisharp.path": "1.32.16" in your VS Code options?
@rchande I see the same problem also with "omnisharp.path": "1.32.16"
.
I tried also with "omnisharp.path": "latest"
. Nothing different.
I have the same problem
omnisharp.json { "MsBuild": { "UseLegacySdkResolver": true } }
This issue resurfaced for me.. The above mentioned fixes didn't fix it this time around for some reason. I'm using the Snap on Solus.. I had already set an alias with alias dotnet="dotnet-sdk.dotnet"
, but I guess that wasn't good enough.
Instead, I used sudo snap alias dotnet-sdk.dotnet dotnet
and that resolved the issue for me.
:heavy_check_mark: Using the following command solved the problem for me on arch-linux:
MSBuildSDKsPath=/opt/dotnet/sdk/$(dotnet --version)/Sdks code my-dotnetcore-project
if I execute the code my-dotnetcore-project
without setting MSBuildSDKsPath
I am able to reproduce the issue.
export
ing environment variable shall also work.
Output of dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 2.2.108
Commit: 33ed5b90ce
Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /opt/dotnet/sdk/2.2.108/
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
.NET Core SDKs installed:
2.2.108 [/opt/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.6 [/opt/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
please let me know if you need some more information for the bugfix. :+1:
heavy_check_mark Using the following command solved the problem for me on arch-linux:
MSBuildSDKsPath=/opt/dotnet/sdk/$(dotnet --version)/Sdks code my-dotnetcore-project
if I execute the
code my-dotnetcore-project
without settingMSBuildSDKsPath
I am able to reproduce the issue.
export
ing environment variable shall also work.Output of
dotnet --info
:.NET Core SDK (reflecting any global.json): Version: 2.2.108 Commit: 33ed5b90ce Runtime Environment: OS Name: arch OS Version: OS Platform: Linux RID: arch-x64 Base Path: /opt/dotnet/sdk/2.2.108/ Host (useful for support): Version: 2.2.6 Commit: 7dac9b1b51 .NET Core SDKs installed: 2.2.108 [/opt/dotnet/sdk] .NET Core runtimes installed: Microsoft.NETCore.App 2.2.6 [/opt/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
please let me know if you need some more information for the bugfix. +1
Excellent!!! Since my dotnet version is preview, I used this in "~/.profile": export DOTNET_ROOT=$HOME/dotnet export PATH=$PATH:$HOME/dotnet export MSBuildSDKsPath=$HOME/dotnet/sdk/$(dotnet --version)/Sdks
Now I can use "code" command as before.
I have used this fix until now but with the last version of omnisharp this workaround doesn't work any more.
I got this issue:
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/gpad/workspace/gpad/azure_service_bus/lb/lb.csproj
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
Omnisharp 1.21.4
I have used this fix until now but with the last version of omnisharp this workaround doesn't work any more.
I got this issue:
[info]: OmniSharp.MSBuild.ProjectManager Loading project: /home/gpad/workspace/gpad/azure_service_bus/lb/lb.csproj It was not possible to find any installed .NET Core SDKs Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from: https://aka.ms/dotnet-download
Omnisharp 1.21.4
Same issue here, started last week.
vscode displays this error but all editor functions continue to work.
I use this workaraound (thanks to @gpad tips) setting MSBuildSDKsPath, DOTNET_ROOT and PATH environment variables before opening VSCode.
I use asdf
to manage dotnet installation, I run this script (I put inside a function in my .zshrc) before running VSCode:
function set-dotnet-vars {
DOTNET_BASE=$(dotnet --info | grep "Base Path" | awk '{print $3}')
echo "DOTNET_BASE: ${DOTNET_BASE}"
DOTNET_ROOT=$(echo $DOTNET_BASE | sed -E "s/^(.*)(\/sdk\/[^\/]+\/)$/\1/")
echo "DOTNET_ROOT: ${DOTNET_ROOT}"
export MSBuildSDKsPath=${DOTNET_BASE}Sdks/
export DOTNET_ROOT=$DOTNET_ROOT
export PATH=$DOTNET_ROOT:$PATH
}
Having same issues. Setting SDK path helps but still having issues. OmniSharp will now load correctly but I still cannot launch a debug session. Any ideas is much appreciated!
Thanks a lot @PaoloLaurenti. Worked perfectly. The only change I made was to place the contents of this function inside the code binary (located in /usr/bin/code
), so I wouldn't have to remember to run the function every time before opening a .Net Core project in VSCode.
@PaoloLaurenti, thank you for the great tip. I've been wondering about this for ages. asdf
offers a convenient way to compute DOTNET_ROOT
, so here is a simplified version of the script that I put in my .bashrc
:
export DOTNET_ROOT="$(asdf where dotnet-core)"
DOTNET_VERSION="$(basename $DOTNET_ROOT)"
export MsBuildSDKsPath="$DOTNET_ROOT/sdk/$DOTNET_VERSION/Sdks"
export PATH="$DOTNET_ROOT:$PATH" # I suspect this is not necessary.
I see from the OmniSharp log in VSCode that OmniSharp finds the correct .NET Core SDK:
[info]: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to "$(asdf where dotnet-core)/dotnet"
However, at face value it doesn't appear that the MSBuildSDKsPath
environment variable gets used:
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 17.1.0 - "~/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '~/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
I feel like I'm overlooking something obvious here if anyone has any suggestions.
is it still not resolved?
having same issue - vs code running on WSL, unable to find dotnet managed by asdf
Environment data
dotnet --info
output:VS Code version:1.33.0 C# Extension version:1.18.0
Steps to reproduce
Build or run from VS Code
Expected behavior
no errors
Actual behavior