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

Cannot find dotnet path #58

Open
Dreamoochy opened this issue Sep 9, 2023 · 5 comments
Open

Cannot find dotnet path #58

Dreamoochy opened this issue Sep 9, 2023 · 5 comments

Comments

@Dreamoochy
Copy link

I have a portable VSCodium (1.82) and portable dotnet sdk (7.0.400). VSCodium is launched via custom cmd-file where DOTNET_ROOT environment variable is set.

In the VSCodium settings there're the following lines:

  "dotnetAcquisitionExtension.existingDotnetPath": [
      {
        "extensionId": "muhammad-sammy.csharp",
        "path": "${env:DOTNET_ROOT}/dotnet.exe"
      }
  ],

When I launch VSCodum, I get an error:

Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
Could not find extension target platform in %vscodium_path%\data\extensions\muhammad-sammy.csharp-2.0.436\.vsixmanifest
[Error - 8:06:48 PM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Cannot find dotnet path '${env:DOTNET_ROOT}\dotnet.exe'
	at t.DotnetRuntimeExtensionResolver.<anonymous> (%vscodium_path%\data\extensions\muhammad-sammy.csharp-2.0.436\dist\extension.js:2:1128383)
	at Generator.next (<anonymous>)
	at s (%vscodium_path%\data\extensions\muhammad-sammy.csharp-2.0.436\dist\extension.js:2:1127327)

I can't remember such a behaviour with the previous versions 1.2x. But I'm not sure it's a free-omnisharp issue.

@KarthikHebbarMN
Copy link

Similar issue, I have a coder-server with dotnet (tried both with 6 and 7) installed, and when I try to install the c# extension it installs and when attempted to load a .cs file it says
Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime Could not find extension target platform in...

@Rebjai
Copy link

Rebjai commented Oct 1, 2023

I had the same issue but solved it by manually putting the path in the extension config, hope it helps

get sdk path

dotnet --list-sdks

image

Extensions> C# configuration:
image

@Dreamoochy
Copy link
Author

I had the same issue but solved it by manually putting the path in the extension config

Thanks, it works. Partially.

  1. It works with the direct paths only, it doesn't recognize paths with environment variables like ${env:DOTNET_ROOT} (or I don't know how to use it properly). And I need it to keep the portability (on MS Windows).
  2. It ends up with the "undefined" is not valid json issue.

@Rikitik
Copy link

Rikitik commented Nov 6, 2023

I'm having issues ith this as well . I'm interested how you made it portable on a USB flashdrive?

@Dreamoochy
Copy link
Author

I'm having issues ith this as well . I'm interested how you made it portable on a USB flashdrive?

To be honest, it's not really portable. Basically it's just able to run from a USB. I've created start.cmd file which sets some session environment variables (dotnet, powershell etc) and adds them to PATH.

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

4 participants