I have an issue in "CallContext.LogicalGetData" method using .net Core when i try to send parameter to runtime text template t4 (net core)
Below tt file :
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ parameter name="firstName" type="System.String" #>
<#@ parameter name="lastName" type="System.String" #>
and Cs call method :
var pt1 = new ParamTemplate1();
pt1.Session = new Dictionary<string, object>();
pt1.Session["firstName"] = "David";
pt1.Session["lastName"] = "Giard";
pt1.Initialize();
var outputText1 = pt1.TransformText();
Console.WriteLine(outputText1);
Hello <#=firstName #> <#=lastName #>!
the problem is du to " System.Runtime.Remoting" library is not supported in .net core
Any ideas or workaround ??
Thanks.
Sorry for the late reply, but if you still want to use the t4 templates, you can replace the parameters directives with properties at the end of the t4 document:
And then call it: