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

dotnet binary could not be found #1338

Open
4 of 5 tasks
avysk opened this issue Jan 9, 2025 · 4 comments
Open
4 of 5 tasks

dotnet binary could not be found #1338

avysk opened this issue Jan 9, 2025 · 4 comments

Comments

@avysk
Copy link

avysk commented Jan 9, 2025

Version

0.75.0

Dotnet Info

❯ dotnet --info
.NET SDK:
 Version:           9.0.100
 Commit:            a2bc464e40
 Workload version:  9.0.100-manifests.6bf02610
 MSBuild version:   17.12.7+a2bc464e4

Runtime Environment:
 OS Name:     FreeBSD
 OS Version:  14
 OS Platform: FreeBSD
 RID:         freebsd.14-x64
 Base Path:   /usr/local/dotnet/sdk/9.0.100/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.
                                                                                                                                            Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       a2bc464e40
                                                                                                                                            .NET SDKs installed:
  8.0.106 [/usr/local/dotnet/sdk]
  9.0.100 [/usr/local/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.6 [/usr/local/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.6 [/usr/local/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/dotnet/shared/Microsoft.NETCore.App]
                                                                                                                                            Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/local/dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

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

Steps to reproduce

fsautocomplete produces the following output:

Unhandled exception: System.Exception: No dotnet binary could be found via the DOTNET_HOST_PATH or DOTNET_ROOT environment variables, the PATH environment variable, or the default install locations
   at Ionide.ProjInfo.Init.init(DirectoryInfo workingDirectory, FSharpOption`1 dotnetExe) in /_//src/Ionide.ProjInfo/Library.fs:line 302
   at [email protected](Boolean projectGraphEnabled, DirectoryInfo stateDirectory, Boolean adaptiveLspEnabled, Boolean useTransparentCompiler) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 152
   at System.CommandLine.Handler.<>c__DisplayClass16_0`4.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.SyncUsingAsync(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at [email protected]() in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 342
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---

Details

It says it cannot find dotnet binary. However, dotnet is in my path; moreover

❯ $DOTNET_ROOT/dotnet --version
9.0.100

Or does it refer to dotnet-fsautocomplete? I do not have this one; I installed fsautocomplete with dotnet tool install -g fsautocomplete.

I am running FreeBSD 14.2; I have installed dotnet8 and dotnet packages.

Logs

No response

Checklist

  • I have looked through existing issues to make sure that this bug has not been reported before
  • I have provided a descriptive title for this issue
  • I have made sure that that this bug is reproducible on the latest version of the package
  • I have provided all the information needed to reproduce this bug as efficiently as possible
  • I or my company would be willing to contribute this fix
@avysk avysk added the bug label Jan 9, 2025
@TheAngryByrd
Copy link
Member

@baronfel do we need to add FreeBSD checks here?

@baronfel
Copy link
Contributor

Seems totally reasonable. In fact, as a last-ditch fallback, we should probably have DOTNET_ROOT and PATH probing for any OS.

@avysk
Copy link
Author

avysk commented Jan 11, 2025

There are many different unices. Why don't you kill all checks besides isWindows instead of adding new ones, and reverse the condition in finding the dotnet binary name (dotnet.exe if on Windows, dotnet otherwise)?

@baronfel
Copy link
Contributor

That's a possibility - we're trying to mirror the host runtime lookup patterns as much as possible here though so I'd want to check what they do.

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

No branches or pull requests

3 participants