Cannot find dotnet path to dotnet

Piotr Karmelita 0 Reputation points
2024-11-23T22:04:30.0766667+00:00

Hello.

I'm trying to set up my C# environment, and run a program. I'm using VSC, with C# and C# DevKit extensions. I tried up to change version of extension to the older version and pin up solution explorer but it brought no result. The output says that dotnet path couldn't be find in spite that I cganged it in my settings.

Below I attach full error message:

[Error - 22:53:05] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Cannot find dotnet path '/snap/dotnet-sdk/254/sdk/dotnet'
	at t.DotnetRuntimeExtensionResolver.<anonymous> (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1141733)
	at Generator.next (<anonymous>)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1140926
	at new Promise (<anonymous>)
	at r (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1140671)
	at t.DotnetRuntimeExtensionResolver.getHostExecutableInfo (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1141341)
	at $.<anonymous> (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1173669)
	at Generator.next (<anonymous>)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163465
	at new Promise (<anonymous>)
	at r (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163210)
	at $.startServer (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1173612)
	at $.<anonymous> (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1168486)
	at Generator.next (<anonymous>)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163465
	at new Promise (<anonymous>)
	at r (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163210)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1168434
	at a.createMessageTransports (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:2274913)
	at a.createConnection (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:2114986)
	at a.start (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:2105501)
	at $.<anonymous> (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1168627)
	at Generator.next (<anonymous>)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163465
	at new Promise (<anonymous>)
	at r (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163210)
	at $.initializeAsync (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1167987)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1164417
	at Generator.next (<anonymous>)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163465
	at new Promise (<anonymous>)
	at r (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163210)
	at t.activateRoslynLanguageServer (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1163620)
	at /home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1201664
	at Generator.next (<anonymous>)
	at s (/home/piotr/.vscode/extensions/ms-dotnettools.csharp-2.50.27-linux-x64/dist/extension.js:2:1199602)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,068 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 67,411 Reputation points
    2024-11-23T23:51:54.6733333+00:00

    The extension is complaining that it can not find the dotnet application. From the command line try

    dotnet —-info
    

    It should show the installed versions and their paths.note: I use a Mac and don’t know typical Linux folder.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.