2009-08-21 231 views
3

的錯誤是:T4模板錯誤

Error 48 A processor named 'PropertyProcessor' could not be found for the directive named 'property'. The transformation will not be run. The following Exception was thrown: 
System.IO.FileNotFoundException: Failed to resolve type for directive processor PropertyProcessor. 
    at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolveDirectiveProcessor(String processorName) 
    at Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, List`1 directivesToBeProcessed) Config.tt 2 4 

的T4模板是:

<#@ template language="C#" #> 
<#@ property name="serverName" processor="PropertyProcessor" type="System.String" #> 

using System; 

如何解決這個問題?這是什麼意思?

回答

6

<#@ property#>是一個自定義指令。它在Visual Studio中不受T4主機的支持。您可以使用GAX主機或提供PropertyProcessor的替代實現,例如Clarius Consulting的T4 Editor中包含的實現。更多here

+0

我在哪裏可以找到關於「GAX」的信息?從來沒有聽說過。 – usr 2009-08-21 14:04:09