I have this post that teaches me about the pdb file and StackTrace.
This is the code.
using System; // https://stackoverflow.com/questions/4474259/c-exception-handling-with-a-string-given-to-a-constructor class WeekdayException : Exception { public WeekdayException(String wday) : base("Illegal weekday: " + wday) {} } class TryCatchFinally { public static void Main() { try { throw new WeekdayException("thrown by try"); } catch(WeekdayException weekdayException) { Console.WriteLine(weekdayException.Message); Console.WriteLine(weekdayException.StackTrace); } } }
With mono, I run
dmcs /debug error.cs mono error.exe
And I get this message the same when I removed the / debug option.
Illegal weekday: thrown by try at TryCatchFinally.Main () [0x00000] in <filename unknown>:0
With Visual Studio 2010, I run
csc /debug error.cs error
To receive this message with a line number as expected.
Illegal weekday: thrown by try at TryCatchFinally.Main() in c:\error.cs:line 15
- Q: Why does mono not show the line number with the mdb file? Did I miss something?
source share