Pablo Galiano : Enabling C# or VB 3.5 inside a text template

Subscriptions

<March 2010>
SuMoTuWeThFrSa
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

News

Subscribe to Pablo Galiano by Email

Post Categories

Enabling C# or VB 3.5 inside a text template

What about adding any C# 3.5 feature (linq, extension methods, partial methods, etc) inside a text template file?

The procedure is really easy, just add the "C#v3.5" or "VBv3.5" to the language directive:

<#@ template language="C#v3.5"#>
<#@ Import Namespace="System.Linq" #>
<#@ Assembly Name="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>

Happy code generation...

Pablo

posted on Tuesday, January 22, 2008 10:38 AM by pga

What do you think?

(required) 
required 
optional
required