Chapter 3 Program and Code File Structure

What’s in This Chapter

  • Project files, including hidden files
  • Changing project properties, references, resources, and assembly information
  • Preprocessor directives
  • The using directive and namespace statements
  • End-of-line, multiline, and XML comments

Wrox.com Downloads for This Chapter

Please note that all the code examples for this chapter are available as a part of this chapter’s code download on the book’s website at www.wrox.com/go/csharp5programmersref on the Download Code tab.

A C# solution contains one or more related projects. A project includes all the files related to whatever output it produces. That output might be an executable program, a custom control, or a code library that other programs can use. The files relating to the output might include files full of C# code, documentation, data files, and any other files you want to include in the project.

This chapter describes the structure of a typical C# project and explains the purposes of some of the most common types of files you can find in a C# project. This chapter also describes the basic structure of C# source code files. It explains how you can use regions and namespaces to group related pieces of code. It also describes some typographic features such as comments, XML comments, and line labels that you can use to make C# code easier to understand.

Hidden Files

Figure 3-1 shows the Solution Explorer window for a solution named TurtleSolution that contains two projects ...

Get C# 5.0 Programmer's Reference 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.