如何在T4模板中使用Linq
这是我的软件环境信息vs2012 .net version 4.0
这是t4模板:
<#@ templatedebug="true" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#@ Assembly Name="System.Core.dll" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Linq" #> 当我调用engine.ProcessTemplate(inputTemplate,host)时,它返回ErrorGeneratingOutput的内容。为什么会这样呢?
发布于 2013-08-15 21:11:11
我知道这是个老问题,但我又找到了同样的东西。
引用System.Core时,不要包含.dll
<#@ assembly name="System.Core" #>发布于 2013-05-11 08:14:44
您需要在visual studio的“错误”窗口中查看错误,以查看更多信息。
您还可以右键单击.tt文件并指定debug template。
https://stackoverflow.com/questions/10968451
复制相似问题