If you want to know how this Visual Studio Command Prompt works or how can you compile your Applications using this tool, then here is a simple guide to you. In this article, I will tell you how can you Compile an Application using this Command Prompt. For example purpose, I will be Compiling the Application which I have made in this one of my other articles How To Create Hello World! Program In C# Using Notepad. Here is snapshot of the code of that Application.
- Open Visual Studio Command Prompt tools by clicking Start button and then All Programs –> Microsoft Visual Studio 2010 –> Visual Studio Tools –> Visual Studio Command Prompt. If you have previous version of Visual Studio, then you can open this tool by replacing 2010 in above hierarchy with your edition of Visual Studio.
- It will open a Command Prompt which will work like a Compiler for us.
- Now move to the directory where your .cs file is located which you want to Compile now
- Type csc followed by a space then your file name which in my case is HowToIdeas.cs and hit Enter. You will get similar kind of output in Console as I have in following Image and it will take some time to Compile the program. Once it is Compiled it will show you the Path where you were i.e D:\ drive in my case.
- If you don’t get any error, then your Program is successfully Compiled and an .exe file with the same name as your .cs file name will got created in the same directory. So you can now run your Program by just typing the name of .exe file and it will show you the output of our Program in Console.
Incoming search terms:
- How to run codes from notepad in visual studio Net (1)