c# - T4模板错误

标签 c# visual-studio visual-studio-2008 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;   

我该如何解决这个错误?什么意思?

最佳答案

<#@ property #> 是自定义指令。 Visual Studio 中的 T4 主机不支持它。您可以使用 GAX 主机或提供 PropertyProcessor 的替代实现,例如 Clarius Consulting 的 T4 Editor 中包含的实现。更多 here .

关于c# - T4模板错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1311627/

相关文章:

.net - VS2010 定期崩溃并出现 System.ArgumentException : Value does not fall within the expected range

c++ - 如何在状态栏中显示 CMFCRibbonButton 的工具提示?

winforms - TableLayoutPanel的行/列着色(vs2008,winform)

c# - Roslyn 代码分析器——什么时候应该使用 "this."?

c# - 获取 UAP10 平台上加载的程序集列表

C# 将文档从 mongodb 读取到 JSON 中并尝试获取值

asp.net - Visual Studio 2010 包括旧版本的 jquery

python - Visual Studio 2019、Python 和 Neuron 模拟器

c++ - 管理 Windows XP 和 Vista/Server 2008 之间的 Windows API 差异

c# - 改进代码 : Compare 2 list of elements