Monday, 3 August 2015

How to Run C# programs without actually installing framework and visual studio.



Hi Friends,
        The important thing when we try to write and execute the program of any language, main issue is the IDE(Integrated Development Environment). When you want to execute c, c++ programs you needs turbo. To run the java program, first we need JAVA to be installed in our m/c. The user has to install this s/w to run programs.

        But in the case of C# we actually do not need to install the .net framework in our m/c. Because Microsoft already provide in build .net framework in our windows OS from windows 7 ultimate to windows 8.1. Just we need to find CSC compiler and set the path. So we can write the program in notepad and run through the command prompt. So to run C3# program, First we need to write program in notepad then run on command prompt. So just follow the following steps and instructions to run your C# programs.


STEP 1:-
        First, you will need to find the Framework. For that you need to open drive in which you installed your OS ( I consider Local Drive C: ). So follow this C:\Windows\Microsoft.NET\Framework64 path to find Framework. SO now you can actually see which version of framework installed in your system. All this will represent in following snapshot:


STEP 2:
In the second step you need to find cse.exe file. So for that we will open latest version framework folder ex v4.0.30319 or may be more. In this folder we will search for csc.exe file. Scenario shown in following snapshot:
 


STEP 3:
        Now you need to set your path of this compiler to run your program from your folder as you want intead of saving file in folder in which CSC.EXE file saved. Follow this procedure to set path right click on my computer>Advanced System Setting>Advanced>Envirement Variable>in System Variable>select path and then edit. There wil be already default path sets without interfaring with them just give the semicolon (;) after the that default paths and write your path of csc compiler. So copy your cse file’s path and paste there. Finally following window will be appear.

 
 



STEP 4:
        Now write your c# program using notepad and save as “filename.cs”, don’t forget to select all files otherwise by default, it will be save as .txt file. Open your command promt, then enter into folder in which you save your progam. So to compile your program use command csfilename.cs , now your program will be compiled. If in the case , any error occurs then remove as per suggestion on command prompt. As an example I will show snapshot of my program after compiling. 





STEP 5 :
        It is time to execute and see output, so for execute your program just use name of your program and hit enter, it will show your output. After compilling your source program get convert into exe file so exe file itself is command.The execution of my program shown in following snapshot.


        So friends all this is, about how to run your c# program without actually you installing framework and visual studio. It is very interesting so try it and enjoy. I hope that you wll definitely like it and if you have any query about it then comment, I will here to solve it as quickly as possible. .




0 Leave comments:

Post a Comment