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)?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With