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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -