使用T4Toolbox时,运行TextTransform.exe时出现问题
|
我正在尝试运行ѭ0来使用T4模板文件生成代码。
模板文件依赖于ѭ1(具体来说,它包含实现T4Toolbox.Template类的类)。
因此,它包含文件“ 2”,其中包含以下指令:
<#@ 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参数和逗号分隔列表的加法指令处理器(我可以看到ѭ6implemented和TransformationContextProcessor
都是在ѭ1so中实现的,因此语法可能类似于XsdProcessor
的规范)。
关于如何摆脱这些错误的任何想法?模板生成可在Visual Studio中完美运行。
没有找到相关结果
已邀请:
1 个回复
骨酚柯
但是,不幸的是,解决这两个问题导致了死胡同。 当前不支持使用T4Toolbox。 http://t4toolbox.codeplex.com/discussions/52069 相反,我正在考虑调用MSBuild。 以下内容非常有用: http://www.olegsych.com/2010/04/understanding-t4-msbuild-integration/#ConfiguringTransformationEnvironment