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:
- 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 selectLLBLGenPro.exe
as the process to attach to. - In the template in the Text Editor, add a
Debugger.Break();
statement. At that location the debugger will break. - Make sure you check the checkbox Enable Template Debugging on the Code Generation Task Viewer dialog, prior to generating code.
- Generate code by clicking Perform Tasks on the Code Generation Task Viewer](../Functionality%20Reference/CodeGenerationTaskViewer.htm) dialog.
- 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.