c# - T4. Error: An expression block evaluated as Null -
i've added template.tt file looks like:
<#@ template language="c#" debug="true" #> <#@ output extension=".cs" #> <#@ import namespace="system" #> <#@ import namespace="system.collections.generic" #> using system; using system.collections.generic; namespace test { public class <#= this.classname#> { } } <#+ public string classname { get; set; } #>
i'm receiving error:
an expression block evaluated null @ microsoft.visualstudio.texttemplating.tostringhelper.tostringwithculture(object objecttoconvert)...
what should avoid seeing these messages?
thanks in advance
the problem classname property null. 1 way fix error change code in class feature block to:
<#+ private string classname = ""; public string classname { { return classname; } set { classname = value; } } #>
Comments
Post a Comment