Entity Framework 6.1 - debug t4 script execution with customized code first reverse engineering

460 views Asked by At

Is it possible to debug the execution of the EntityType.cs.t4 and Context.cs.t4 scripts, triggered from the Entity Data Model Wizard (i am not using Power Tools, but the wizard from EF 6.1), when adding "ADO.NET Entity Data Model" item to a VS project and selecting the "Code First from Database" option ? If yes, how exactly (I added breakpoints in the t4 files above, but none of them were triggered) ? I could not find any description about that.

I did some custom changes in these files, and would like to debug the process of generating code first code from an existing database.

1

There are 1 answers

0
RickyTad On

No, it does not help. These EF 6.1 templates are executed in the context of the Visual Studio entity data model wizard, cannot be executed "manually". The two t4 script files do not have the "standard" *.tt file extension, but *.t4. The purpose is to debug the code generation.