![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Can please anyone tell me why do i get only the first method in which the exception was thrown and not the line that triggered the exception ? I don't know if I set something in VS2005 wrong or what the hell is wrong .... I have a Windows Service in RELEASE mode , on VS2005 C# ..... So to summarize ... when the exception is thrown, I catch it and display the stacktrace of the exception, but as I said above, only the calling method is showen..... the exception is thrown in QueueService.queueTimer_Elapsed method ..... Thanks a lot. Kris Example : here I would expect to see the line of exception or at least the name of the method .... at ReportQueueService.QueueService.queueTimer_Elapsed (Object sender, ElapsedEventArgs e) at System.Timers.Timer.MyTimerCallback(Object state) at System.Threading._TimerCallback.TimerCallback_Cont ext(Object state) at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state) at System.Threading._TimerCallback.PerformTimerCallba ck(Object state) |
#3
| |||
| |||
|
|
CallStacks don't have line numbers in them, only the method names. When running code the runtime runs IL, not C#--so line numbers are meaningless at that point. -- Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote. http://www.peterRitchie.com/blog/ Microsoft MVP, Visual Developer - Visual C# "Kristijan Marin" wrote: Hi, Can please anyone tell me why do i get only the first method in which the exception was thrown and not the line that triggered the exception ? I don't know if I set something in VS2005 wrong or what the hell is wrong .... I have a Windows Service in RELEASE mode , on VS2005 C# ..... So to summarize ... when the exception is thrown, I catch it and display the stacktrace of the exception, but as I said above, only the calling method is showen..... the exception is thrown in QueueService.queueTimer_Elapsed method ..... Thanks a lot. Kris Example : here I would expect to see the line of exception or at least the name of the method .... at ReportQueueService.QueueService.queueTimer_Elapsed (Object sender, ElapsedEventArgs e) at System.Timers.Timer.MyTimerCallback(Object state) at System.Threading._TimerCallback.TimerCallback_Cont ext(Object state) at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state) at System.Threading._TimerCallback.PerformTimerCallba ck(Object state) |
#4
| |||
| |||
|
|
I understand, but as I said, I would expect a little more form StackTrace then just the Parant method .... cause if i have a method with 100 lines, and exception occures in some iostream like "ReadLine" then I would expect to see that Exception occured in "ReadLine" method |
#5
| |||
| |||
|
|
Kristijan Marin <kristijan.marin (AT) triera (DOT) net> wrote: I understand, but as I said, I would expect a little more form StackTrace then just the Parant method .... cause if i have a method with 100 lines, and exception occures in some iostream like "ReadLine" then I would expect to see that Exception occured in "ReadLine" method And unless inlining has occurred, this will usually be the case. However, without a short but complete program demonstrating the problem, it's hard to say why you're not seeing the behaviour you expect. -- Jon Skeet - <skeet (AT) pobox (DOT) com http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet World class .NET training in the UK: http://iterativetraining.co.uk |
#6
| |||
| |||
|
Ok now we understand each other ..... ....So please tell me, could it be possible that I somewhere turned some VS or Project property off or on and this now gives the "not expected" stack result ? |
|
I doubt that program example would somehow help, cause this is happening to all Window Service applications that i have so I think that it could be some VS settingproblem .... but don't know which .... |
#7
| |||
| |||
|
|
Hi, Can please anyone tell me why do i get only the first method in which the exception was thrown and not the line that triggered the exception ? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |