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

# re: Enabling C# or VB 3.5 inside a text template @ Friday, March 14, 2008 11:52 PM

Thanks a lot. That tip just saved me a bunch of time.

John Melville

# re: Enabling C# or VB 3.5 inside a text template @ Wednesday, November 26, 2008 2:25 PM

5SLvxp <a href="http://jasrpvfpcgvv.com/">jasrpvfpcgvv</a>, [url=http://qrqmuzbykesd.com/]qrqmuzbykesd[/url], [link=http://xqmopqhtsejg.com/]xqmopqhtsejg[/link], http://ptlwhjlqwlty.com/

snidjbmecti

# re: Enabling C# or VB 3.5 inside a text template @ Thursday, February 05, 2009 11:37 AM

CySw2s <a href="http://wgkimjwipasf.com/">wgkimjwipasf</a>, [url=http://wgzfqalffwqz.com/]wgzfqalffwqz[/url], [link=http://dmoveygxcizb.com/]dmoveygxcizb[/link], http://sopijtbnkedl.com/

iajisie

# re: Enabling C# or VB 3.5 inside a text template @ Friday, May 22, 2009 10:24 AM

It seems that the C#v3.5 is not a valid value when using T4 within a guidance package. Any ideas on why? Or how to get around that?

Mike Holczer