5

Is there a way to automatically run the T4 transform when another file is saved?

Dariusz Woźniak
  • 9,640
  • 6
  • 60
  • 73
devlife
  • 15,275
  • 27
  • 77
  • 131

3 Answers3

4

The AutoRunCustomTool Visual Studio extension was created to address this exact scenario.

Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
  • Hello, I would like to ask you as an author of this extension. Do you plan to maintain this extension for future versions of Visual Studio? e.g. VS 2015? I just started to use your extension and it seems to be great. Your last version is from 11/2013 (version 2.0.1). Thank you – user2126375 May 27 '15 at 22:05
  • @user2126375, yes, I'm still maintaining it, I just didn't need to modify it since 2013. I haven't checked if it works in VS2015 yet, but I'll make sure it does. – Thomas Levesque May 28 '15 at 07:35
  • Thanks for info. I tested AutoRunCustomTool in VS 2015 RC and it seems to be working. – user2126375 May 29 '15 at 17:37
2

It seems like T4 Toolbox is not available for VS2012. However there is now a feature in tangible T4 Editor that allows you to simply add a auto-transformed template to any exisitng file in your solution so that when the parent file is saved the dependend t4 file is transformed. See here:

http://t4-editor.tangible-engineering.com/blog/dependent-t4-templates.html

1

You can do that with T4 Toolbox. Select the file in Solution Explorer and set the Custom Tool Template in the Properties window.

I get this answer form How can set the custom tool property of an xml file to a T4 file?

Community
  • 1
  • 1
Omid Shariati
  • 1,904
  • 5
  • 22
  • 44