How to Run C# code in VS code?
Steps:
1: Install vs code Link
2: Got to https://dotnet.microsoft.com/
3: Click on Download or direct go to this Link
4: Download it and Install it by just simple default steps.
5: Go to vscode and Install 3 Extensions
i) C# by Microsoft
ii) C# Snippets by Jorge Serrano
iii) C# Extension by JosKreativ
6: To create Project: dotnet new console
$ dotnet new console
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.201
Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
7: To execute: dotnet restore
$ dotnet restore
Determining projects to restore...
All projects are up-to-date for restore.
8: To run: dotnet run
$ dotnet run
Hello, World!
What is your name:
Aryan
---------------------
My name is : Aryan
No comments:
Post a Comment