.net - 简单的 T4 模板在 Visual Studio 2010 中不起作用,但在 MonoDevelop 中起作用吗?

标签 .net visual-studio-2010 mono t4

我有各种各样的 hell 让 Visual Studio 2010 编译我的 T4 模板。我很确定这个相同的模板在 2008 年有效,但我现在无法确认。我确信它适用于 MonoDevelop。

无论如何,这是我模板的标题:

<#@ template language="C#v3.5" hostspecific="true" #>
<#@ output extension="cs" #>
<#@ assembly name=“System.Core” #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Linq" #>

Visual Studio 2010 提示第一行,即模板指令:

A directive was specified in the wrong format. The transformation will not be run. Please specify the directive in the format <#@ name [parameterName="parameterValue"]* #>



为什么这不能按预期工作?

最佳答案

我的问题是我复制并粘贴了 assembly指令,它使用了 “”而不是 ""
另外,我发现它作为错误给出的行号基本上毫无意义。

关于.net - 简单的 T4 模板在 Visual Studio 2010 中不起作用,但在 MonoDevelop 中起作用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11442667/

相关文章:

c# - WinForm 事件处理程序激活速度太慢

visual-studio-2010 - VS2010 负载测试 : Cannot connect to test controller

.net - P/调用和单声道 : EntryPointNotFoundException

c# - CaSTLe Windsor 争论不休的生活方式

.net - 向下箭头不会触发 KeyPress 事件

c# - .net core 2 的编码问题

c++ - #导入 : Cannot open file "soap12.h" for reading gSoap in VS 2010

c# - 在单声道中编译时 C# List 的问题(与作业相关)

c# - 在 Mac 上使用 C#/Mono 的仅系统托盘(无停靠图标)应用程序

c# - 如何使用 WebHttpBinding 在 WCF 的 uri 路径中使用强类型参数