I am not able to get intellisense for C# on vscode.
I used rtx-cli, which is basically like asdf, to install dotnet 7.0.306
on Ubuntu 22.04.2
. I can run dotnet
command on my terminal.
I enabled shims with rtx
as well, so there is a $HOME/.local/share/rtx/shims
in the path. which dotnet
points to inside that directory.
In VSCode, I installed the recommended Microsoft C# extension. I also set the following 2 settings in my user level vscode config:
"dotnetAcquisitionExtension.existingDotnetPath": [
"$HOME/.local/share/rtx/installs/dotnet/7.0.306/dotnet",
],
"dotnet.dotnetPath": "$HOME/.local/share/rtx/installs/dotnet/7.0.306",
Here is the output of dotnet --list-runtimes
:
Microsoft.AspNetCore.App 7.0.9 [$HOME/.local/share/rtx/installs/dotnet/7.0.306/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.9 [$HOME/.local/share/rtx/installs/dotnet/7.0.306/shared/Microsoft.NETCore.App]
And here it is for dotnet --list-sdks
:
7.0.306 [$HOME/.local/share/rtx/installs/dotnet/7.0.306/sdk]
I created the project with dotnet new console --framework net7.0
which gave me a folder with Program.cs
, myapp.csproj
, an obj
directory. I also created a myapp.sln
file with dotnet new sln
.
When I open VSCode, I get the notification that .NET Core SDK cannot be located: A valid dotnet installation could not be found...
I am not able to get any auto complete or error squiggles in vscode when I edit the c#
file.
NOTE: $HOME
everywhere up above is a placeholder. I actually used the real absolute path.