gpt4 book ai didi

linq - t4 模板 linq 问题

转载 作者:行者123 更新时间:2023-12-01 13:31:58 25 4
gpt4 key购买 nike

如何在 T4 模板中使用 Linq

这是我的软件环境信息
VS2012
.net 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 .这是为什么?

最佳答案

我知道的老问题,但我刚刚发现了同样的事情。

当您引用 System.Core , 不包括 .dll :

<#@ assembly name="System.Core" #>

关于linq - t4 模板 linq 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10968451/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com