PC Review


Reply
Thread Tools Rate Thread

Any way to get Framework to return Line number of my code?

 
 
felecha
Guest
Posts: n/a
 
      28th Jun 2004
I'm pretty new to .Net. I'm writing a Service and I have a number of
debug statements that go to a log, and I was thinking - it would be
wonderfully convenient if I could get the line number of my source
code into the log. I have done it "manually" with statements that
have the line number hard coded into them, but every time I change
the source above them, those line numbers are "out of date". Not a
real big problem, just something I'm curious about.


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
 
Reply With Quote
 
 
 
 
Sunny
Guest
Posts: n/a
 
      28th Jun 2004
Hi,

if you compile with debug symbols, maybe you can use StackTrace and
StackFrame classes to get the information.

Sunny

In article <(E-Mail Removed)>, (E-Mail Removed)-
spam.invalid says...
> I'm pretty new to .Net. I'm writing a Service and I have a number of
> debug statements that go to a log, and I was thinking - it would be
> wonderfully convenient if I could get the line number of my source
> code into the log. I have done it "manually" with statements that
> have the line number hard coded into them, but every time I change
> the source above them, those line numbers are "out of date". Not a
> real big problem, just something I'm curious about.
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return the Line Number where the Error Occured RyanH Microsoft Excel Programming 5 15th Oct 2008 04:28 PM
How can I see a text code, such as the code for 'line return'? =?Utf-8?B?QmxhY2toYXdr?= Microsoft Word Document Management 3 26th Jan 2006 09:15 PM
How to return a code number to system in C#? =?Utf-8?B?UmFmYWVsQw==?= Microsoft C# .NET 3 4th Aug 2004 07:39 PM
Re: Return the line number to a variable Suzanne S. Barnhill Microsoft Word New Users 0 12th Dec 2003 04:45 PM
Return Query line number Harold M Microsoft Access Queries 0 31st Jul 2003 10:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 PM.