TransUniv

Friday, January 23, 2015

How to execute C# programs in cmd

                  If you want to compile and run C# programs via cmd (Command Prompt) instead of using Visual Studio C# Express IDE then follow the following simple steps .




1. Find Microsoft.NET installation path.


        You might know the Microsoft.Net is the framework to make windows based applications with various programming languages. This .Net path is installed in your systems windows directory.
Just copy this path. "C:\Windows\Microsoft.NET\Framework\v4.0.30319". The version number (v4.0.30319) may vary based on your .Net framework version.



2. Change your path in cmd.


        Open the command prompt and change the directory to where the c# source codes are saved. Check out following screenshot.



3. Set path to .Net Framework.


          Now set .Net framework's path to your working directory to compile and run the programs like shown in the screenshot below.



4. Compile and Run


       Now you are ready to compile and run your programs.


  • To compile the program use "csc File_name.cs" (Without Quotes) for example "csc helloworld.cs".
  • To run the program use "File_name" (Without Quotes) for example "helloworld".
     


  Hope it was useful to you.



Today's Quote:

                       "Be the change you want to see in the world".
  
                                                                                            - Mahatma Gandhi.



        

5 comments:

  1. Great information...Your post the very informative i have learned some information about your blog thank you for Sharing the great information.....
    Weblife Infotech

    ReplyDelete
  2. I have been looking for this kind of blog. and I explore various software testing services. but couldn't find like that. There is a firm Insbytech which also writing these kind of blogs and also giving free consultations to their clients.

    ReplyDelete
  3. Nice Blog! Are you looking to kickstart your career in the IT field? Enroll in the BCA course at IIMT Rohtak. This course offers in-depth knowledge and practical skills needed for a successful career in technology. Start your career journey today with the best BCA course in Rohtak at IIMT!

    ReplyDelete