Debugging T4 Template in VS 2010 Crashes IDE

后端 未结 5 1387
刺人心
刺人心 2021-02-04 05:08

I\'m trying to debug a slightly-modified version of the ADO.NET POCO Entity Generator template using the directions Oleg Sych published a few years back. I modified th

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 05:45

    Instead of using System.Diagnostics.Debugger.Launch(); or Break(), attach the debugger manually.

    1. In a second instance of vs2010, open the T4 template you want to debug (just the .tt file is fine)
    2. Go to Debug -> Attach to Process and find the original devenv.exe process
    3. Add a regular breakpoint (red ball) to the place you want to start the debug (in the second vs2010 still)
    4. Go to the original vs2010, save the .tt file and... bingo! The second instance of vs2010 will debug your template.

提交回复
热议问题