olegsych / T4Toolbox

http://olegsych.github.io/T4Toolbox
MIT License
257 stars 111 forks source link

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

Open dotfede opened 8 years ago

dotfede commented 8 years ago

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?