There are loads of arguments on the web about how you should style your code. These are my preferences, you can think of them as the law
.
-
Use
StyleCop. This is an absolute no-brainer. If you live in the Microsoft world, then you should use this. Yes, it is only for C# so if you write in C++ I don't think it will help. If you write in VB.NET, then unlucky - hopefully your employer forces you to do so and it is not by choice

. In case you are too lazy to click on the link, StyleCop analyses your source code to ensure that it doesn't break any styling conventions.
-
Use
FxCop. This one can be really important. FxCop will check your compiled .NET assembly to check for various things ranging from overflows to attribute usage.
-
Use
Sandcastle (and if you want, its
GUI). It's a great tool that will create documentation for your assemblies. Well worth it if you work in a team or if you expose your APIs to third parties.
-
Use
Guidelines and don't type past them! I like code that is 80 columns wide - that means that I don't need to scroll horizontally on my laptop (1280*800) and I can view 2 files side by side on my main workstation (1920 * 1200).
If you are working as part of a team (and sometimes even if you are not), you should be using a continuous integration server. CruiseControl.NET seems to be held in high regard although I have recently had a good experience with TeamCity. It is very easy to set up - the only downside is that, unless you pay, it is limited to 20 builds. While this seems like plenty, if you have a "build" for the actual compilation, another for your unit tests, and one for each of the tasks above, you soon need to spend some £££.
Regarding StyleCop, I use all of the default rules except for "SA1027: TabsMustNotBeUsed". IMO, it is just silly to use spaces instead of tabs. Why should I use 4 key presses when one will do? Tabs also mean that if a member of your team is a little bit odd and they like 2 spaces - or 8 - then they can just configure Visual Studio so that it looks right for them. The only problem would be if a team member actual likes pressing space instead of tab (thanks to JK for pointing this out).
Regarding FxCop, suppressions are the last resort! Try very hard not to use them.
I will post soon with a project that obeys the rules.
UPDATE: You can download an example of The Law at the end of this post.
f460ffd3-bbb0-4126-9e4b-27c6c6aa093e|0|.0