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}

Developer technologies | Visual Studio | Debugging
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Developer technologies | C#
Developer technologies | 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.
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.