Compile time trace info

S

shumaker

Is there a way to get information like line number, function name, etc.
at compile time?

Something like:

MessageBox.Show( "Executed at" + __LINE__ + " in " + __FUNCTION__ );

The suggestions I've seen in this regard deal with doing this at
runtime which will only work if the code is not obfuscated, not
optimized, and includes debug information. I would prefer to insert
this information at compile time instead.
 
S

Stoitcho Goutsev \(100\)

As far as I know there is no way to do this at least not with C#. That was
possible in C++, but I don't know if they still support it in .NET versions
of the compiler.
 

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