This project has moved. For the latest updates, please go here.

How to Add Header from T-4 script

Mar 22, 2013 at 2:24 PM
Edited Mar 27, 2013 at 2:47 AM
I would like to know if it is possible to have my license header added to a file generated by a T-4 script? I'm using EF 5.0 and a T-4 script to create DBContext files, from time to time, changes need to be made. However the file's header is lost upon regeneration.
Mar 22, 2013 at 2:33 PM

I have no idea.

LHM currently offers a few Visual Studio commands (e.g., Edit.AddLicenseHeader and ProjectandSolutionContextMenus.Items.LicenseHeaders.AddLicenseHeaders), and it supports attaching to existing commands (e.g., ReSharper_SilentCleanupCode).

If you can either trigger the LHM commands from the T4 generation, or if there is a command you can attach to, you should be able to invoke the LHM's functionality.

Best regards,
Mar 27, 2013 at 2:48 AM

Thanks for the fast response. I ended up adding the header within the .tt file and it generates the header when changes to the edmx or the script file has any cahnages.

Again, great tool!!!