c# - T4 Template throws error when inserting a control block -


i using following line in text template file

 <settingsfilepath>  <#=getparametervalue("blah")#>\deploy\settings\deploymentsetting_<#environment.name#>_<#=workflow.name#>.xml  </settingsfilepath> 

when try modify line insert expression (environment.type.tostring()) follows

<settingsfilepath> <#=getparametervalue("blah")#>\deploy\settings\<#=environment.type.tostring()#>\deploymentsetting_<#environment.name#>_<#=workflow.name#>.xml </settingsfilepath> 

i following error in visual studio compilation of tt templates

an unexpected start or end tag found within block. make sure did not mis-type start or end tag, , not have nested blocks in template.

does know doing wrong? <#= #> blocks matched.

thanks everyone. worked around using string.format per aaron's suggestion

<settingsfilepath><#=string.format(@"{0}\deploy\settings\{1}\deploymentsetting_{2}_{3}.xml",getparametervalue("blah"),environment.type.tostring(), environment.name, workflow.name)#></settingsfilepath>       

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -