We really need Preprocessed Templates (runtime) working.

Oct 25, 2013 at 3:08 PM
Hi Oleg and everyone else,

We really needs preprocessed templates working on VS2012. To be honest, I don't know why anyone uses the standard templates for anything other than one offs. Preprocessed templates are way more intuitive: you can inherit templates, templates aren't nested, etc.

I don't know how hard it would be to update this functionality for the VS2012 build, Oleg didn't make it sound like it would be that big of a deal. For some reason it had to be in a separate distribution or something.

Oleg, please let us know when this functionality will be included. We don't hear from you very often anymore. Perhaps you can release the source code to the community.

Nov 18, 2013 at 7:37 PM
Edited Nov 18, 2013 at 7:41 PM
Good News Everyone,

Oleg sent me info for a work-around to get Preprocessed Templates working. I made the easy changes and IT WORKS! See his email below:

I don’t have plans to add support for preprocessed templates to T4 Toolbox for Visual Studio 2012. I may be able to reintroduce it in a future version of T4 Toolbox, but don’t have specific plans to do it at this time. If you are using preprocessed T4 Toolbox templates to build a Visual Studio extension, you can work around  the current limitation by referencing the required assemblies in project that contains the preprocessed T4 Toolbox templates explicitly. You will need these references:
•   Microsoft.VisualStudio.TextTemplating.11.0.dll
•   Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll
•   T4Toolbox.dll

The first two can be found in the Add Reference dialog under Assemblies->Extensions. The T4Toolbox.dll assembly is deployed in a subfolder under %localappdata%\Microsoft\VisualStudio\12.0\Extensions. The subfolder name is generated each time a new version of the VSIX is installed and I recommend placing a copy of the DLL in your source control repository to avoid having to constantly update the reference.

The T4Toolbox.dll references should have its “Copy Local” property set to False. This dll should not be deployed with your own extension because it would introduce conflicts with the copy deployed by the T4 Toolbox VSIX package.

Hope this helps,
Sep 17, 2015 at 8:49 PM
I also am trying to get preprocessed templates to work.
I followed the instructions that Mike passed on from Oleg from the previous post.
I added the references and included a reference to T4Toolbox.dll.
As suggested I included a copy of this DLL in my local solution path and set the 'copy local' property to false.

I reduced the content of my TextTemplate1.tt template content to the following few lines:

<#@ template language="C#" hostspecific="true" #>
<#@ output extension="txt" #>
<#@ include file="T4Toolbox.tt" #>

I set the custom tool property to: TextTemplatingFilePreProcessor

I am getting the following error:
'T4ToolboxPreProcessedTEmplates.TextTemplate1.Dispose(bool)': no suitable method found to override

Can someone help me get past this?