我試圖運行TextTransform.exe
使用T4模板文件生成代碼。 模板文件依賴於T4Toolbox
(具體而言,它包含實現T4Toolbox.Template類的類)。使用T4Toolbox時運行TextTransform.exe的問題
因此,它包括文件t4toolbox.tt
,其中包含以下指令:
<#@ dte processor="T4Toolbox.DteProcessor" #>
<#@ TransformationContext processor="T4Toolbox.TransformationContextProcessor" #>
在執行過程中,我得到了兩個引用處理器以下錯誤:
C:\Program Files\T4 Toolbox\t4toolbox.tt(1,4) : error : A processor named 'T4Toolbox.DteProcessor' could not be found for the directive named 'dte'. The transfo
rmation will not be run. The following Exception was thrown:
System.IO.FileNotFoundException: Failed to load directive processor T4Toolbox.DteProcessor.
at Microsoft.VisualStudio.TextTemplating.CommandLine.CommandLineHost.ResolveDirectiveProcessor(String processorName)
at Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, List`1 directivesT
oBeProcessed)
我運行帶有以下參數的exe文件:
TextTransform.exe
-I "C:\Program Files\T4 Toolbox"
-P "[Framework3.5],[VS2008 PublicAssemblies]"
-dp "XsdProcessor!T4Toolbox.XsdProcessor!T4Toolbox.dll"
-r "T4Toolbox.dll" mytemplate.tt
我試過在多重指令處理器中加入多個-dp參數,並用逗號分隔列表(我可以看到DteProcessor
和TransformationContextProcessor
都在T4Toolbox
中實現,所以推測其語法類似於XsdProcessor
的規範?)
關於如何擺脫這些錯誤的任何想法?模板生成在Visual Studio中完美運行。
仍然沒有其他辦法解決這個問題嗎? – Gluip 2016-11-09 12:42:14