Search code examples
asp.net.netasp.net-core.net-coresdk

'dotnet --version' is returning 'You must install or update .NET to run this application.'


I have installed .net SDK 6.0.419 from here. After installing when I ran 'dotnet --version' I encountered below error.

You must install or update .NET to run this application
App: C:\Program Files\dotnet\sdk\6.0.419\dotnet.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '6.0.27' (x64)
.NET location: C:\Program Files\dotnet\

No frameworks were found.

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

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.27&arch=x64&rid=win-x64&os=win10

Also when I run list sdk,runtime commands, I'm getting the below versions without any error.

C:\Users\sharmapulkit> dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

C:\Users\sharmapulkit> dotnet --list-sdks
6.0.419 [C:\Program Files\dotnet\sdk]

Can someone help me with this.


Solution

  • You should download the sdk here and install it.

    Then you can run dotnet --list-runtimes command, if you can see Microsoft.NETCore.App 6.0.27 like below, then you can run the web application.

    enter image description here