What is the meaning of <# = #>

Reading T4 code creation and text templates , and I found this syntax <# = DateTime.Now #>

<html><body>
 The date and time now is: <#= DateTime.Now #>
</body></html>

How is it different from <%= DateTime.Now %>or <%# DateTime.Now %>.

Google search did not show

+5
source share
1 answer

I can't claim to be really familiar with T4 text patterns, but there seems to be a difference between creating the create / build time code (which may include executable statements) and executing the execution code.

So, it <#= #>evaluates the expression inside the template used to create the file.

<%= %> . JIT-, , , , , .

<%# %> , .

. .

< # =... # >

, , "5":

<#= 2 + 3 #>

: http://msdn.microsoft.com/en-us/library/bb126478

+4

All Articles