This document may be read as a guide to writing robust and reliable programs. It focuses on programs written in C#, but many of the rules and principles are useful even if you write in another programming language.

2 File Organization
2.1 C# Sourcefiles
Keep your classes/files short, don’t exceed 2000 LOC, divide your code up, make structures clearer. Put every class in a separate file and name the file like the class name (with .cs as extension of course). This convention makes things much easier.
2.2 Directory Layout
Create a directory for every namespace. (For MyProject.TestSuite.TestTier use MyProject/ TestSuite/TestTier as the path, do not use the namespace name with dots.) This makes it easier to map namespaces to the directory layout.

3 Indentation
3.1 Wrapping Lines
When an expression will not fit on a single line, break it up according to these general principles:
- Break after a comma.
- Break after an operator.
- Prefer higher-level breaks to lower-level breaks.
- Align the new line with the beginning of the expression at the same level on the previous line

Download pdf C# Coding Style Guide