It compiles the source code into an assembly. It is named as csc.exe.
We can call the C# compiler manually or by using Visual Studio's IDE (Integrated Development Environment).
To compile manually,
1. We have to save our program with extension of '.cs'
2. And then open the command prompt and invoke the compiler like
RootFolder(Windows Directory)\Microsoft .NET\Framework\
i.e, csc MyProgram.cs. It will generate MyProgram.exe.
3. Now to create a library, do like below,
csc /target:library MyProgram.cs.
Asked In: Spotted While Learning |