Skip to content

.NET Runtime Not Found While Running Dotnet Global Tools #41293

Closed as not planned
@phadkesharan

Description

@phadkesharan

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When attempting to run a .NET global tool, the application fails to locate the .NET runtime, even though the runtime and tools location have been added to the PATH variable. This issue persists despite following the recommended environment variable settings.

error message while running dotnet-ef

You must install .NET to run this application.

App: /home/phadkesharan/.dotnet/tools/dotnetsay
Architecture: x64
App host version: 8.0.5
.NET location: Not found

Learn more:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:

Expected Behavior

The global tool should execute without errors, locating the .NET runtime as specified in the environment variables.

Steps To Reproduce

Environment
Operating System: [Specify your OS and version, e.g., Ubuntu 22.04]
.NET SDK Version: [Specify the .NET SDK version installed, e.g., 8.0.5]
Architecture: x64

Steps to Reproduce

  1. Install .NET SDK and runtime following the official installation instructions.
  2. Add the following lines to the ~/.bashrc file:
    # Dotnet Core
    export DOTNET_ROOT=$HOME/.dotnet
    export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
  3. Source the ~/.bashrc file:
    source ~/.bashrc
  4. Install a global tool, for example:
    dotnet tool install --global dotnet-ef
  5. Attempt to run the global tool:
    dotnet-ef

Exceptions (if any)

No response

.NET Version

8.0.105

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions