Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T4 code generation without Visual Studio 2010?

Is it possible to run T4 code generation without needing Visual Studio 2010? Basically I have to build an in house ORM (don't ask..if I had a choice I wouldn't). I was planning to use subsonic as a base but change some things and how they work. However my main question is can I run T4 from an external application that I write, so I can use the features of T4? Or am I better off doing it myself (which I doubt)?

like image 401
user203538 Avatar asked Dec 28 '22 09:12

user203538


1 Answers

TextTransform.exe will do what you want for simple scenarios:

http://msdn.microsoft.com/en-us/library/bb126245.aspx

Here is how to run a T4 template from your own code for templates created in VS 2010:

http://msdn.microsoft.com/en-us/library/ee844259(VS.100).aspx

And here is how to run a T4 template from your own code for templates created in VS 2008:

http://www.capprime.com/software_development_weblog/PermaLink,guid,104d9faf-5780-42ca-88e5-c04cb88f61b3.aspx

There will be some issues running Subsonic T4 templates outside Visual Studio:

How can I automate the t4 code generation for SubSonic

I would stick to T4 rather than roll your own template engine.

like image 154
Michael Maddox Avatar answered Jan 11 '23 13:01

Michael Maddox