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

Absolute path to omnisharp executable isn't handled properly anymore #5449

Closed
prettybits opened this issue Nov 9, 2022 · 1 comment · Fixed by #5456
Closed

Absolute path to omnisharp executable isn't handled properly anymore #5449

prettybits opened this issue Nov 9, 2022 · 1 comment · Fixed by #5456

Comments

@prettybits
Copy link

Issue Description

With the update to 1.25.1 an absolute path to an omnisharp executable isn't properly picked up anymore, instead a custom omnisharp path is always assumed to be a dotnet command:

OmniSharp server started with .NET 6.0.110
.
    Path: /usr/bin/omnisharp
    PID: 158269

[STDERR] Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-/usr/bin/omnisharp does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

This is due to the change introduced in 6a538af merging DotNetLaunchPath with LaunchPath and in the process also removing the check for launch paths that don't end with .dll. @50Wliu

Steps to Reproduce

  • Install Omnisharp outside of the extension, e.g. via the omnisharp-roslyn AUR package on EndeavourOS/Arch Linux in my case
  • Provide the absolute path to the Omnisharp executable for the omnisharp.path configuration variable, e.g. /usr/bin/omnisharp
  • (Re-)Start Omnisharp and see the error in the OmniSharp log output as shown above

Expected Behavior

OmniSharp from a configured absolute path should be picked up and started directly, like it worked in 1.25.0.

Actual Behavior

Absolute Paths aren't checked for but assumed to be dotnet commands, thereby failing to start the server.

Environment information

VSCode version: 1.73.0
C# Extension: 1.25.1

Mono Information There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.110 Commit: ce0a42998a

Runtime Environment:
OS Name: endeavouros
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/6.0.110/

global.json file:
Not found

Host:
Version: 6.0.10
Architecture: x64
Commit: 5a400c212a

.NET SDKs installed:
6.0.110 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info

Visual Studio Code Extensions
Extension Author Version
csharp ms-dotnettools 1.25.1
csharpier-vscode csharpier 1.3.5
dotnet-interactive-vscode ms-dotnettools 1.0.3552060
EditorConfig EditorConfig 0.16.4
intellicode-api-usage-examples VisualStudioExptTeam 0.2.6
msbuild-project-tools tintoy 0.4.9
roslynator josefpihrt-vscode 4.1.2
sonarlint-vscode SonarSource 3.11.0
vscode-solution-explorer fernandoescolar 0.7.4
vscodeintellicode VisualStudioExptTeam 1.2.29
@winstliu
Copy link
Contributor

winstliu commented Nov 9, 2022

Ah ha, I see the issue. I forgot you can specify custom launch paths. Thanks for the report @prettybits!

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

Successfully merging a pull request may close this issue.

2 participants