Back in the Visual Studio 2003 days, you had to go to File – Page Setup, and check “Line numbers” (in the lower-left hand corner) in order to print line numbers, regardless whether they were visible in the editor. For Visual Studio 2005, we moved this option to the Print dialog.
To print line numbers, go to File – Print, and on the lower left, you’ll see two options.
As a bonus tip, (since a "did you know how to hide collapsed regions when printing" makes me yawn), you can also hide collapsed regions. I’ve used this when I wanted to print out just my test case function, but didn’t want to print out any of the helper functions, since they all lived in the same test case file.
The picture above (printed to a xps file) shows how the "hidden collapsed regions" will print out as ellipses.
Technorati tags: VS2005Tip, VS2008Tip