Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Process Macro variables into T4 TextTemplate

$
0
0

I've a problem when I try to invoke the text transformation in a VSExtension.

// Get the text template service: 

ITextTemplating t4 = serviceProvider.GetService(typeof(STextTemplating))  as ITextTemplating;

var vsHostEngine = t4 as ITextTemplatingEngineHost;

ITextTemplatingSessionHost sessionHost = t4 as ITextTemplatingSessionHost;

sessionHost.Session = sessionHost.CreateSession();

sessionHost.Session["Rigenerate"] = parameter;

TemplateCallBack templateCallBack = new TemplateCallBack();

// Process a text template: 

string result = t4.ProcessTemplate(templateFullFilePath, templateContent, templateCallBack)


When I Call t4.ProcessTemplate(....) the template engine don't process the macro variables $(SolutionDir) (for example) and this issue generate in a template process error.

My Question is: how I can I do to resolve the MacroVariables?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>