A.5. Compiling and Running C# Programs

As with all other programming languages, C# source code must be compiled before the program can be run. This section presents the basics of compiling and running C# programs.

A.5.1. C# Source Code Files

The C# language gives a fair amount of flexibility in naming C# source code files, but there are some conventions that are usually followed:

  • Although it's not an absolute requirement, the recommended convention is to end source code file names with the extension .cs.

  • It's also considered good practice for the name of a C# source file to match the name of the class or interface defined within that file.

  • The code for two or more class or interface definitions can be placed in the same source file; we don't ...

Get Beginning C# 2008 Objects: From Concept to Code 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.