VS2008 for VB.NET の T4 テンプレートで PGK.Extensions を使用しようとすると、次のようになります。
RemoveAllSpecialCharacters は文字列のメンバーではありません..
私の T4 ヘッダー:
<#@ template language="VB" hostspecific="false" debug="true" inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" #>
<#@ output extension="vb" #>
<#@ assembly name="PGK.Extensions.dll" #> // the dll is found
<#@ import namespace="StringExtensions" #> //Try with and without namespace
ブロック コードでの拡張機能の使用:
<#
Me.WriteLine(item.Name.RemoveAllSpecialCharacters.ToUpper)
#>
RemoveAllSpecialCharacters は、PGK.Extensions.dll の文字列拡張メソッドです。
誰でも私を助けることができますか?
編集:
わかった。これは:
<#@ template language="VBv3.5" ...
しかし、これは VS2008 プラグインの DevArt T4 Editor のインテリセンスと構文の強調表示を壊します。代わりに Tangible T4 Editor を使用してください。