Setting a breakpoint in a T4 template

Posted by Dave Swersky on Stack Overflow See other posts from Stack Overflow or by Dave Swersky
Published on 2010-03-23T15:31:57Z Indexed on 2010/03/23 21:03 UTC
Read the original article Hit count: 337

Filed under:
|
|

I'm trying to debug the execution of a T4 template in Visual Studio 2008.

All the information I'm finding on debugging T4 templates in Visual Studio 2008 say that you can set a breakpoint (red dot) in the template as if it were a regular code file. I have the Clarius T4 code highlighter installed, so my T4 template is colored, but I can't set a breakpoint. When I click in the margin nothing happens.

I've tried Debugger.Break(), and it launches a new instance of VS.NET, but it can't load the code from my template. I get a dialog that says "There is no source code available for the current location." This happens if I have the same project loaded in the another instance of if I spin up a new instance.

What gives?

© Stack Overflow or respective owner

Related posts about visual-studio-2008

Related posts about T4