This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
hi - i've got two t4 templates which i'm using to generate dtos off a LS model. (because i don't want the dtos in the same assembly as the model).
this might be a bit messy - esp if t4 template gen falls over, but maybe an event could be raised which would allow a macro to be fired which would regen the t4 templates...? maybe that's a bit rubicesque...?
|
|
|
This is a T4 issue and I don't believe there's a lot we can do about it, but Joachim Lykke Andersen has found a technique by which you can force a T4 template to regenerate before building the project. He's written it in terms of a particular ASP.NET MVC template but as far as I can tell his solution should work for any T4 template mutatis mutandis. Take a look at http://devtalk.dk/2010/03/11/How+To+Run+T4MVC+On+Build.aspx and see if that helps. I'd recommend his second version, the one with RunCustomTool(), over the first version. Since you want to trigger on a specific file, you might also be able to use DocumentEvents.OnDocumentSaved instead of BuildEvents.OnBuildBegin. But hopefully this will serve as a starting point. |
|
|
Also, apparently this: http://www.weirdlover.com/2010/07/18/chirpy-attains-godlike-abilities-in-version-1-0-0-4/#autorun has a feature for auto-running T4 templates, which looks like it is more project-based rather than global (plus no VBA, which is always a good thing). Why does a JavaScript minifier have an option to run T4 files? Beats me, guvnor. I only report these things, I don't make 'em up. |
|