c# - T4 Text Templating -



c# - T4 Text Templating -

i have next .tt file wish utilize include file want expose properties main t4 files:

include.tt

<#@ assembly name="$(projectdir)bin\debug\epplus.dll" #> <#@ assembly name="system.configuration.dll" #> <#@ import namespace="system.io" #> <#@ import namespace="system.collections.generic" #> <#@ import namespace="system.configuration" #> <#@ import namespace="system.text" #> <#@ import namespace="system.text.regularexpressions" #> <#@ import namespace="officeopenxml" #> <# public static string ediinputpath { { homecoming configurationmanager.appsettings["inputpath"]; } } #>

when saving code throws 7 compile time errors first 1 saying "statement expected".

i don't utilize t4 templates not exclusively sure doing wrong here.

the easiest way see going wrong alter customtool property on t4 file texttemplatingfilepreprocessor. can see generated code within visual studio.

in case problem within standard command block

<# #>

you can have statements work within method. t4 template engine set these statements within transformtext() method outputs text template.

you have defined property not allowed within method. property code needs go class feature block:

<#+ #>

c# t4 texttemplate

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -