In general having the debugger attached just before the RunCodeGeneration method call should be enough to debug the code generation template. For more details about this process I suggest you take a look at this blog post.
Regarding the inconstant behavior of the template execution that you have described - I was not able to reproduce this behavior both using our Fluent Library and the RLINQ file with Fluent Mapping which is a deprecated approach because our Fluent API is designed to be a code only approach providing auto-generated code only one time at the beginning.
Please bear in mind that if you use an RLINQ file with Fluent mapping the FluentModel.tt code generation template will not be used because the RLINQ files are using the DefaultTemplateCS.tt one while only the one-time code generation of our Fluent Library is using the FluentModel.tt for its code generation.
If you still experience the same behavior after considering the above-mentioned information could you please provide us with more details about the Fluent approach that you use (Fluent Library or RLINQ file with Fluent mapping)?
Also if you need advice or assistance with the modifications could you please provide us with more details about the goals that you need to achieve which will help us suggest you the recommended approaches and practices?
I am looking forward to your feedback.
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features
shipped with our latest release!