question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet-sdk installs bogus `~/.dotnet/tools` entry as `/etc/paths.d/dotnet-cli-tools`

See original GitHub issue

We installed dotnet-sdk using brew today and the /etc/paths.d/dotnet-cli-tools it created injected a bogus ~ into the system PATH variable which results in kubectl getting upset.

The /etc/paths.d directory (managed by /usr/libexec/path_helper) takes static files and literally inlines their contents into a produced PATH env string.

This PATH env string is not later evaluated, which means that a ~ in a file in /etc/paths.d, as in: /etc/paths.d/dotnet-cli-tools:

~/.dotnet/tools

Will not get converted into the equivalent of $HOME/.dot/tools.

This gets reported by victims in issues such as kubernetes/kubectl#574.

I think that this is caused by: https://github.com/dotnet/sdk/blob/a30e465a2e2ea4e2550f319a2dc088daaafe5649/src/Cli/dotnet/ShellShim/OsxBashEnvironmentPath.cs#L23-L78

https://github.com/Homebrew/homebrew-cask/issues/112988

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Tony-Solcommented, Jun 6, 2023

Please, add env variable to define path to tools! It’s all kind a mess with different paths of tools, datas, etc. - best way is make dotnet follow XDG spec in all platforms according to this or similar

1reaction
jsorefcommented, Nov 14, 2021

I’d half argue in favor of adding a /usr/local/bin/.dotnet-tools instead and making that a symlink to $HOME/.dotnet/tools.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The .NET Core SDK cannot be located. . ...
Just simply close your VS Code app. It seems the error is produced because you are installing .NET Core SDK when your VS...
Read more >
Troubleshoot .NET tool usage issues
Discover the common issues when running .NET tools and possible solutions.
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Unable to locate the .NET SDK: The Reasons - Hamid Mosalla
Navigate to C:\Program Files\dotnet\sdk and see if you can find folders associated with different sdk versions. If you can't find any folder ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found