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

It was not possible to find any installed .NET SDKs. #4409

Closed
dstpierre opened this issue Feb 24, 2021 · 11 comments
Closed

It was not possible to find any installed .NET SDKs. #4409

dstpierre opened this issue Feb 24, 2021 · 11 comments

Comments

@dstpierre
Copy link

I'm trying to work on dotnet 5 project from my Debian Linux OS.

Here's the error I'm getting from Omnisharp log:

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/dstpierre/src/labs/ProfilNav/ProfilNav.csproj
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
  https://aka.ms/dotnet-download

I have one dotnet SDK installed:

$ which dotnet
/snap/bin/dotnet
$ dotnet --version
5.0.103

I suppose the extension has some kind of preset to search for dotnet SDK, like in /usr/local/bin for instance.

I've tried to find a setting I could change and could not find anything related to the path of the dotnet installed.

What can I do from here? How can I tell the extension where to look for the installed dotnet?

Thanks

@JoeRobich
Copy link
Member

@dstpierre The dotnet SDK resolver has issues with Snap installs. I found this comment on the dotnet/sdk snap issue that may resolve your issue - dotnet/sdk#10403 (comment)

@JoeRobich
Copy link
Member

Please let me know if those instructions work for you and I'll add them to the Wiki.

@dstpierre
Copy link
Author

I linked the snap version, in my case was:

# ln -s /snap/bin/dotnet /usr/local/bin/dotnet

Now doing a:

$ which dotnet
/usr/local/bin/dotnet

Reloaded the vs code sample project and it's still saying no SDK version found.

Feel free to close this, as I'm not going to pursue trying further.

@JoeRobich
Copy link
Member

@dstpierre If you are able, installing the SDK from Apt should work.

@JoeRobich
Copy link
Member

Also, there is another workaround listed on our Wiki.

@rhyek
Copy link

rhyek commented Apr 4, 2021

# ln -s /snap/bin/dotnet /usr/local/bin/dotnet

This worked for me on Ubuntu 20.10 using ms-dotnettools.csharp version v1.23.9 with no additional setup.

@dstpierre
Copy link
Author

I've decided to regive another try, this time I installed dotnet-core SDK via asdf, I've create the symlink like @rhyek said it was working for them, here's my link

$ ls -al /usr/local/bin/dotnet
lrwxrwxrwx 1 root root 34 May 11 14:52 /usr/local/bin/dotnet -> /home/dstpierre/.asdf/shims/dotnet
$ which dotnet
/home/dstpierre/.asdf/shims/dotnet

I've added with the omnisharp.json workaround that @JoeRobich mentioned.

I've always the same issue. I just re-installed the extension and all dotnet since last February, but still the same issues.

Any pointer? We have old .NET 4.5 ASP.NET code bases that I'd like to migrate, but can't figure how to have the extension to find the damn .NET core version.

@dstpierre
Copy link
Author

nevermind, the version 5 is now available via apt I followed those instructions which worked for me: https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian

@shahidriaz
Copy link

# ln -s /snap/bin/dotnet /usr/local/bin/dotnet

This worked for me on Ubuntu 20.10 using ms-dotnettools.csharp version v1.23.9 with no additional setup.

It did not worked for me - Unfortunately

@attairsilva
Copy link

# ln -s /snap/bin/dotnet /usr/local/bin/dotnet

Isso funcionou para mim no Ubuntu 20.10 usando ms-dotnettools.csharp versão v1.23.9 sem configuração adicional.

Não funcionou para mim - Infelizmente

Também não funcinou para mim

@attairsilva
Copy link

attairsilva commented Feb 10, 2022

Para dar certo no meu caso, eu removi a instalação que fiz via snap, e como @dstpierre sugeriu fiz pelo apt:

# sudo snap remove dotnet-sdk

Instalação pelo APT:

# wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
# sudo dpkg -i packages-microsoft-prod.deb
# sudo apt-get update; 
# sudo apt-get install -y apt-transport-https
# sudo apt-get update 
# sudo apt-get install -y dotnet-sdk-6.0

Em seguida configurei o path

# sudo nano ~/.bashrc
Inclui no final os caminhos (para o meu Ubuntu 20.04, foi colocado dentro do usr/share o dotnet):

DOTNET_ROOT=/usr/share/dotnet/sdk/6.0.102
export PATH=$PATH:$DOTNET_ROOT/current

No final carreguei as variaveis de ambiente com

# source ~/.bashrc

Depois inclui no settings.json do VSCODE para que fosse baixada uma versão anterior do OmniSharp ao reinicia-lo :

    "omnisharp.useModernNet": true,
    "omnisharp.path": "latest"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@JoeRobich @rhyek @dstpierre @shahidriaz @attairsilva and others