Line numbers should be available when compiling in Debug as long as you keep the pdb files in the application directory.
This will also work in Release if you enable PDB creation, as per Justin’s answer.
If you are interested, more information can be found at PDB Files (MSDN)