Compile line # into text with C#?

D

Dick Bridges

I want to compile the line number (and module name) into the text when
throwing an exception. I don't want to create a StackFrame. This isn't
debug code. I simply want the module name and line number *COMPILED* into
the message (i.e., __FILE__ and __LINE__).

Please tell me this can be done. Then, if you'd be so kind, point me toward
the docs that describe how! ;)

TIA
 
D

Daniel O'Connell [C# MVP]

Dick Bridges said:
I want to compile the line number (and module name) into the text when
throwing an exception. I don't want to create a StackFrame. This isn't
debug code. I simply want the module name and line number *COMPILED* into
the message (i.e., __FILE__ and __LINE__).

Please tell me this can be done. Then, if you'd be so kind, point me
toward
the docs that describe how! ;)

You can't. The compiler does not support anything like this. Its
unfortunate, but...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top