I am big fan of shared projects and I want to use T4 templates similarly: reference shared project in different solutions and get access to generated content without hassle.
How to make T4 templates work in shared projects?
So far the easiest way to organize it is to link .tt
files:
.tt
files from it (drag them with Alt key into target project or use Add - Existing item - Open - combo option "As link").Custom Tool
property (in file options) as TextTemplatingFileGenerator
in target project (which is not possible in shared project and the reason of all troubles).Seems to work, though it's not really uses shared project feature. Shared project is only used as a container for .tt
files (any other project will do, but shared project doesn't produce output, so it's better imho) which are linked to target project.
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