title: Inheriting a T4 template from a custom base class, providing Visual Studio 2010 SDK is not installed
body: <p>I have a system of T4 templates — <em>executed at run-time</em>, not at compile-time — which generate the skeletons of many classes in my app. All these templates reside in a generator tool which is used from time to time to pre-generate new classes into the destination app. The tool contains a configuration class whose properties parameterize the output of all T4 templates.</p>
  
  <p>Originally the configuration class was a static class. However, as the class generator tool grows, it's better to make it non-static and rather make a new instance for each use. The problem is how to pass this instance to the instances of T4 templates. The natural way seems to be inheriting them from a common base which would be provisioned with the configuration class instance.</p>
  
  <p>The problem is that the <code>TextTransformation</code> class, which would have been inherited by my custom T4 base class, is located in an assembly which (according to sources like <a href="https://stackoverflow.com/questions/559027/cannot-find-microsoft-visualstudio-texttemplating-assembly">this SO question</a>) doesn't ship with Visual Studio 2010. Instead it's provided within the Visual Studio 2010 SDK.</p>
  
  <p>The base class generated by VS2010, although itself having no ancestor, isn't partial so there's no way to 'inject' the custom ancestor via another partial declaration.</p>
  
  <p>Thus <strong>the question is:</strong> Is there a way to inherit a run-time-executed T4 template from a custom base class without the need to install Visual Studio 2010 SDK?</p>
  
  <p><strong>Disclaimer:</strong> I'm not very familiar with T4, so I might be completely wrong about how to approach the problem. Hence any other architectural advice is welcome, although my aim isn't to create a super-architected generator — it's just a helper tool, which shall be simple and understandable to the occasional reader.</p>