I have a T4 template system - executed at runtime, not at compile time, which generate skeletons of many classes in my application. All of these templates are in the generator tool, which from time to time is used to pre-create new classes in the target application. The tool contains a configuration class whose properties parameterize the output of all T4 templates.
The configuration class was originally a static class. However, as the class generator tool grows, it is best to make it non-static and rather create a new instance for each use. The problem is how to pass this instance to T4 instances. The natural way, apparently, inherits them from a common base, which will be provided with an instance of the configuration class.
The problem is that the TextTransformation class, which would be inherited by my usual T4 base class, is in an assembly that (according to sources like this SO question ) does not ship with Visual Studio 2010. Instead, it is provided in the Visual Studio 2010 SDK.
The base class generated by VS2010, although it does not have an ancestor, is not partial, so there is no way to "enter" a custom ancestor through another partial declaration.
So the question is: Is there a way to inherit the T4 runtime template from a custom base class without having to install the Visual Studio 2010 SDK?
Disclaimer: I am not very familiar with T4, so I could be completely mistaken in how to approach the problem. Therefore, any other architectural advice is welcome, although my goal is not to create a super-archived generator - it's just an auxiliary tool that should be simple and understandable for the casual reader.
source share