Crono
Crono

Reputation: 10478

Is there a way I can put T4 directives inside comment brackets?

Consider the following code:

<#@ assembly name="$(Path)\Custom.dll" #>
<#@ assembly name="$(OtherPath)\Custom.dll" #>

I'd like to do something in the likes of:

<#@ assembly name="$(Path)\Custom.dll" #>
<!--<#@ assembly name="$(OtherPath)\Custom.dll" #>-->

Is there a syntax that allows me to put directives in comment?

Upvotes: 0

Views: 75

Answers (1)

Frank
Frank

Reputation: 2198

I don't think so because T4 uses regex to parse out the code and directives from the files when it compiles them. The regex statement it uses is searching for <#@ and #> lines and considers everything else to be part of the template.

Upvotes: 1

Related Questions