The Seven Steps to Writing a Simple C# Program

After you have successfully installed the .NET SDK and chosen a suitable editor you are ready to write and run your C# programs. This can be accomplished by performing the following seven steps (shown here by using pseudocode):

1.
Open the command console.
2.
Use the chosen text editor to type and edit the C# source code and save this text as a .cs file.
3.
Use the C# language compiler to turn this source code into a PE (.exe) or DLL (.dll) file.
4.
If the compiler detects any syntax errors in step 3, go back to step 2 and correct these errors. Continue through steps 3, 4, and so on.
5.
Run the program.
6.
Verify that the output matches your expectations. If this is not the case, go back to ...

Get C# Primer Plus now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.