Show correct line-numbers in stack-traces
The line-numbers in a strack-trace counts from the top of the produced .cs file. This includes the using-statements, and first few lines of the UserQuery class definition. The user has no way of knowing how many such lines there are, so the line-numbers would be almost useless.
To remedy this, LINQPad could add #line-directives
#line 1 "UserQuery" // Just before the user-code
#line default // Just after the user-code.
Manually adding #line-directives results in the exception-indicators being placed on wrong lines, but the stack-traces are more useful.
Read more:
http://msdn.microsoft.com/en-us/library/34dk387t.aspx
http://msdn.microsoft.com/en-us/library/szc67b5s.aspx
http://msdn.microsoft.com/en-us/library/dd233195.aspx
-
Markus Jarderot commented
Or more appropriately, the full filename of the .linq-file:
#line 1 "C:\Users\Markus\Documents\LINQPad Queries\MyQuery.linq"