Tuesday, June 24, 2014

Debugging in LINQPad

If you have ever used LINQPad (http://www.linqpad.net/) for writing and testing out your LINQ Queries, you may have noticed that there are no built-in debugging tools in the LINQPad IDE for setting breakpoints etc.

Fortunately, however, you can use Visual Studio to debug into your LINQ queries that you compose in LINQPad!!

You simply follow these steps to be able to step into your LINQPad queries:

  1. Add the following code to your LINQPad query where you want a breakpoint 
    if(Debugger.IsAttached)
        {
            Debugger.Break();
        }

  2. From within Visual Studio, open the Debug menu and select Attach to Process
  3. Select the LINQPad.exe process and click on the Attach button
  4. Execute your LINQ query within LINQPad
  5. Notice that the LINQ query gets pulled into Visual Studio for debugging allowing you to step through the code!



No comments:

Post a Comment