olegsych/T4Toolbox

Need help trying to run a Template from VSIX code without a .tt file in the target project

Opened this issue · 0 comments

So: I'm trying to programatically execute a TextTransformation that would generate many new files in the target project, but I need to do so without the target project having any .tt files at all.

I've tried every possible combination of ITextTemplatingEngine, ITextTemplatingEngineHost, TransformationContext, and so on, but I get the "T4 Toolbox transformation context was not properly initialized." error every time.

I can't add the t4toolbox.tt include because I don't actually have any .tt file to begin with, I'm creating a CSharpTemplate 100% programatically by inheriting the class and overriding TransformText().

All this is running in the context of a VSIX extension for Visual Studio 2015.

Is this even possible?