R – SubSonic 3 Regenerate ActiveRecord Class Automatically

activerecordmsbuildsubsonic3

I have a SQLite database and SubSonic3, finally got a clue on how to generate the .cs from the .tt in Visual Studio. My stuff builds now.

I can kick off MSBuild automatically to build my project, but I would like to add a pre-build event to regen the ActiveRecord.cs cleanly so any database changes end up there for future Unit tests.

How can I simulate the 'run external tool' in the Visual Studio GUI?

Thanks.

Best Answer

You can run the TextTemplating tool from the command line:

C:\Program Files\Common Files\Microsoft Shared\TextTemplating\1.2\TextTransform.exe "path/to/your/ttfile.tt" -out <outFileName>

Use TextTransform.exe /help for more command line arguments you can use.