title: Creating reusable scaffolders
body: <p>I followed the instructions on <a href="http://average-uffe.blogspot.ca/2011/06/basics-in-t4scaffolding-in-visual.html" rel="nofollow">creating a custom scaffolder</a> using the <a href="http://nuget.org/packages/T4Scaffolding" rel="nofollow">T4 Scaffolding</a> package and they worked great. However, in the process I found out that I need to build a lot of reusable components that will be shared across multiple scaffolders and templates. </p>
  
  <p>I know I can build a class library and register it in the GAC to make it accessible to the powershell scripts and T4 templates, but in a team environment, that is not always possible. I'd prefer to check-in the reusable components to source control and make them accessible somehow.</p>
  
  <p>One approach I took was to split the T4 templates into multiple files and <code>include</code> all of them into the master template. </p>
  
  <pre><code>&lt;#@ include file="Extensions.cs.t4" #&gt;
  </code></pre>
  
  <p>However, if I define a class in any one of the templates, the class becomes a nested class and therefore can not be static (for example).</p>
  
  <p>Is there a way to build re-usable classes, methods, extensions and make them accessible to custom scaffolders without installing them to the GAC? The T4Scaffolding package has a number of <a href="http://mvcscaffolding.codeplex.com/wikipage?title=T4Scaffolding%27s%20cmdlets%20for%20use%20in%20custom%20scaffolders&amp;referringTitle=Documentation" rel="nofollow">utility functions accessible in the custom scaffolder</a>. How did they do it?</p>