How to compile program without Visual Studio’s magic.

Samples: At first, we should make a file for example "Program.cs"
 
using System;
public class Program{
 public static void Main(){
  Console.WriteLine("wert!");
 }
}
 
Now, we should run Visual Studio XXXX Command Prompt and input there following commands:  csc.exe /out:c:SamplesCompilingProgram.exe /t:exe /r:MSCorLib.dll
c:SamplesCompilingProgram.cs.
 
Which means: Compile me code by CSharp compiler. Code is located in c:SamplesCompilingProgram.cs file and make a executable file(/t[arget]:exe). When you
compile dont’t forget that some types are external types in the assembly identified by the MSCorLib.dll file(/r:MSCorLib.dll).  After compiling put executable file into
c:SamplesCompilingProgram.exe(/out).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s