Question: I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name.

Is that usual?? Is it down to Debug / Release builds??

Answer: 
The `StackTrace` property of the `Exception` class contains line numbers, at least if the debug information (pdb file) is available:

```
using System;
class Program {
    public static void Main() {
        try {
            throw new Exception("test");
        } catch (Exception e) {
            Console.WriteLine(e.StackTrace);
        }
    }
}

```

will give the following output with the pdb file:

```
at Program.Main() in X:\code\test\test\Program.cs:line 6

```

and this without:

```
at Program.Main()

```
My app is a ClickOnce app (WPF) and I had to do something a little different:

Project Properties designer > Publish > Application Files

check the Show All Files checkbox

find the pdb file and set its dropdowns there to include it

I had Pdb-only set at:
 Build > Advanced > Debug Info

Not sure if that matters.