How to fix error I want to run C# in VS code but it give me error

Tanzeela Fatima 0 Reputation points
2025-01-29T03:51:22.9633333+00:00
'dotnet' is not recognized as an internal or external command,
operable program or batch file.
. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.

2025-01-29 08:52:17.031 [info] Did not find .NET 8.0.10 on path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime


{7F7860FB-62AC-44A3-B24B-72B96AA893F9}

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,447 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.
11,306 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,025 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dou Xu-MSFT 250 Reputation points Microsoft Vendor
    2025-01-29T05:24:06.2066667+00:00

    Hello @Tanzeela Fatima

    Welcome to Microsoft Q&A forum.

    If you want to build a .NET application in Visual Studio Code, you'll firstly need to install the .NET SDK.

    Please check the following steps:

    1.Download and install the SDK.

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

    2.Add SDK's path to user or system environment variables.

    Navigate to SDK location(e.g:*C:\program files\dotnet\sdk{version}*) and add it to env variables to be recognized by cmd.

    3.Open a terminal and run the following command to see which versions of the .NET SDK are currently installed.

    dotnet --list-sdks
    

    Docs Referred:

    Build a NET application in Visual Studio Code

    How to check that .NET is already installed

    Please feel free to let us know the results.

    Best Regards,

    Dou


    If the answer is helpful, please click "Accept Answer" and upvote it.

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.