Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Created August 22, 2025 18:36
Show Gist options
  • Select an option

  • Save peteristhegreat/264e0a938b2456af44cff33a8598560d to your computer and use it in GitHub Desktop.

Select an option

Save peteristhegreat/264e0a938b2456af44cff33a8598560d to your computer and use it in GitHub Desktop.
You must install .NET to run this application. Dotnet runtime issues. WSL/Debian

How to Fix dotnet runtime missing in WSL

Symptom

You try to run a dotnet project and you get:

You must install .NET to run this application.

App: /home/phyatt/.dotnet/tools/dotnet-outdated
Architecture: x64
App host version: 8.0.18
.NET location: Not found

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

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=linux-x64&os=ubuntu.24.04&apphost_version=8.0.18

Original Install Process

wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
DOTNET_SDK_VERSION=8.0
sudo ./dotnet-install.sh --channel ${DOTNET_SDK_VERSION} --install-dir /opt/dotnet

Diagnostics

dotnet --info
dotnet --list-runtimes
uname -m
file some-dotnet-binary-not-running

Solution

Make sure the right environment variables are set, or put a copy of dotnet in the most common location that dotnet checks.

export DOTNET_ROOT=/opt/dotnet
export DOTNET_ROOT_X64=/opt/dotnet

Add these two exports to your session in ~/.bash_profile or ~/.bashrc or similar.

@peteristhegreat

Copy link
Copy Markdown
Author

Note that Csharpier and the C# extension in vscode really want a newer version of dotnet installed to do anything.

So be sure to install whatever one they are demanding in addition to the version you are targeting for development.

 dotnet tool install csharpier
 dotnet tool run csharpier --version
 dotnet tool restore

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