Scenario:
I've recently learned about Mark Russinovich's useful DebugView* utility.
With DebugView, even with vs2008 closed, I can use statements like this:
System.Diagnostics.Debug.WriteLine("some text =. " + some_variable);
I would like to modify the above, at compile time, to include the source code line number:
System.Diagnostics.Debug.WriteLine("nnnn: some text =. " + some_variable);
where nnnn represents the source code line number.
AFAIK, to do this, vs2008 would need some form of meta variable like @linenumber for current compile time source code line number. i.e., if the Debug.Writeline statement
is on the tenth line, then such a meta-variable would == 10.
Thus, a debug statement such as the rough example above could be used in multiple places and it would be easy to identify the source code location of each debugging statement.
QUESTION: are there meta variables that can be referenced at compile time?
P.S.: I could not find the answer to this question via Google and also via SO search feature.
- http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
"DebugView for Windows v4.76", Mark Russinovich; October 16, 2008