When I run dotnet build
, I get
You must install or update .NET to run this application.
App: /usr/share/dotnet/sdk/7.0.305/dotnet.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.8' (x64)
.NET location: /usr/share/dotnet/
No frameworks were found.
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.8&arch=x64&rid=ubuntu.22.04-x64
but when I run dotnet --info
I get
$ dotnet --info
You must install or update .NET to run this application.
App: /usr/share/dotnet/sdk/7.0.305/dotnet.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.8' (x64)
.NET location: /usr/share/dotnet/
No frameworks were found.
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.8&arch=x64&rid=ubuntu.22.04-x64
Host:
Version: 7.0.5
Architecture: x64
Commit: 8042d61b17
.NET SDKs installed:
6.0.411 [/usr/share/dotnet/sdk]
7.0.305 [/usr/share/dotnet/sdk]
.NET runtimes installed:
No runtimes were found.
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/usr/lib/dotnet]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
My projects are using .NET Core 6, but I have "DOTNET_ROLL_FORWARD": "Latest"
in my launch.json
.
How can the SDK be installed but no runtimes — but they are because I can run dotnet --info
.
I did notice that when I run which dotnet
I get /usr/bin/dotnet
and that is different than the value of DOTNET_ROOT
, but I don’t know if that’s something else.
What’s weirder, is this has been working – it just started doing this and I cannot figure it out.
The https://aka.ms/dotnet/app-launch-failed
URL was not helpful.
2
Answers
I also encountered the same issue.
Initially, I installed the .NET environment, according to the Microsoft instructions:
https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#register-the-microsoft-package-repository
Then I used this command:
But after some time it stopped working and was complaining about the missing framework:
Last time I removed dotnet and installed it again, and it helped me.
But now I encountered that issue again, and I suspect that there is some incompatibility between the dotnet SDK and environment. So, when the SDK is updated and the runtime has an older version, it stops working.
This time, I downloaded the runtime here as the terminal output suggests:
https://dotnet.microsoft.com/en-us/download/dotnet/7.0
Then I manually replaced all the files in the
/usr/share/dotnet
folder. And it is working for me again.If I encounter that issue again, I will confirm if that is a workaround that always helps.
I have the same issue, it never worked for me even though the installations are "successful" when i write this in my shell:
./dotnet-install.sh –version latest –runtime aspnetcore
I check my PATH and i have this: /home/tetratrux/.dotnet/tools
So if anyone has an idea … 🙂