How to debug a template

To debug a template, your template has to be written using the .lpt system, where you can use C# as the template language. Please see the LLBLGen Pro SDK for details about .lpt templates.

Debugging takes place inside VS.NET. Please follow these steps to break into a template during code generation:

  1. Right before running the code generation task, attach a new, empty VS.NET instance to the designer. To do that, press inside VS.NET Ctrl-Alt-P and select LLBLGenPro.exe as the process to attach to.
  2. In the template in the Text Editor, add a Debugger.Break(); statement. At that location the debugger will break.
  3. Make sure you check the checkbox Enable Template Debugging on the Code Generation Task Viewer dialog, prior to generating code.
  4. Generate code by clicking Perform Tasks on the Code Generation Task Viewer](../Functionality%20Reference/CodeGenerationTaskViewer.htm) dialog.
  5. When the template is executed, the empty VS.NET instance will stop at the Debugger.Break(); statement you added, with the template code loaded in its executed form. You can now start debugging.