How To Run C# .Net Programming Language On Windows using Visual Studio(vs code 2019 version) and using command prompts
There are two ways to run C# code on Windows:
1. Through Microsoft Visual Studio software
-Open Visual Studio.( click here to download it: https://visualstudio.microsoft.com/downloads/)
-On the menu bar, choose File -> New -> Project.
-Choose Console Application.
-Specify a name for your project and click OK button.
-This creates a new project in Solution Explorer.
-Write code in the Code Editor.
-Click the Run button or press F5 key to execute the project. A Command Prompt window appears that contains the line Hello World.
2. Through Windows Command Prompt: -You can compile a C# program by using the command-line instead of the Visual Studio IDE -
-Open a text editor and add the above-mentioned code.
-Save the file as helloworld.cs
-Open the command prompt tool and go to the directory where you saved the file.
-Type csc helloworld.cs and press enter to compile your code.
-If there are no errors in your code, the command prompt takes you to the next line and generates helloworld.exe executable file.
-Type helloworld to execute your program.





Comments
Post a Comment