When I try to use Blazer it seems that .NET Framework SDK 6.0 is not installed

Nuno Pimenta 1 Reputation point
2022-05-16T20:22:13.623+00:00

When I try to use Blazor it seems that .NET Framework SDK 6.0 is not installed.

Console comands:
'dotnet' comand:

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.

path-to-application:
The path to an application .dll file to execute.

'dotnet -version' comand
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
* You intended to execute a .NET program:
The application '-version' does not exist.
* You intended to execute a .NET SDK command:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download

Why? How can I fix it?

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,378 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,204 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,041 Reputation points
    2022-05-16T21:14:37.77+00:00

    it appears you installed the runtime, and not the sdk. just install the sdk

    https://dotnet.microsoft.com/en-us/download/dotnet/6.0

    0 comments No comments

  2. Zhi Lv - MSFT 32,006 Reputation points Microsoft Vendor
    2022-05-17T01:50:43.913+00:00

    Hi @Nuno Pimenta ,

    When I try to use Blazor it seems that .NET Framework SDK 6.0 is not installed.

    You can use the following commands to display the installed SDKs:

    dotnet --list-sdks  
    

    202444-image.png

    or:

    dotnet --info  
    

    If you don't install the Asp.net 6 SDK, you can download and install it from here: .NET 6.0.
    Or, if you are using Visual Studio 2019/2022, you can also install the .Net 6 SDK and runtime via the Visual Studio Installer(select the .Net 6 Runtime).

    202485-image.png

    Besides, if installed .Net SDK multiple times, it might also meet this error. To solve it, you can remove the installed SDKs first, and then use the above methods to install the .Net 6 SDK again.

    Refer this thread: Could not execute because the application was not found or a compatible .NET SDK is not installed..


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion

    0 comments No comments