【问题标题】:T4 templates in VS 2010 Cannot Find Metada file SubSonic.Core.dllVS 2010 中的 T4 模板无法找到 Metada 文件 SubSonic.Core.dll
【发布时间】:2010-09-05 17:57:17
【问题描述】:

我正在使用 Subsonic 3 生成 DAL。此外,我正在使用 T4 模板从 DAL 生成我的 BO。 Subsonic 的 T4 模板工作正常,但是当我运行我的模板时出现以下错误:

Compiling transformation: Metadata file 'SubSonic.Core.dll' could not be found

我在settings.include 文件中导入了 SubSonic,如下所示:

<#@ assembly name="SubSonic.Core.dll" #>

我指的是SubSonic.Core 项目(我已经下载了代码)。 GAC 中没有安装 SubSonic,但 DAL 项目正在生成代码,只是这样的文件。

编辑 1:- 如果我删除 &lt;#@ assembly name="SubSonic.Core.dll" #&gt; 它会出现新的错误:

Compiling transformation: The type or namespace name 'SubSonic' could not be 
found (are you missing a using directive or an assembly reference?)

编辑2:-我已经通过添加&lt;#@ assembly name="SubSonic.Core.dll" #&gt; 来解决这个问题,正如我在回答我的this 问题时所建议的那样,但那是在VS 2008 中。不知道为什么这在VS 2010 中不起作用。

编辑 3:- 将 SubSonic.Core.dll 安装到 GAC,重新启动 VS,仍然出现该死的错误。应该睡吧。

【问题讨论】:

  • @Henk 有一个链接指向我得到第一个解决方案的问题。
  • 它实际上说的是“SubSonc.Core.dll”,还是“SubSonic.Core.dll”?

标签: c# visual-studio-2010 subsonic3 t4


【解决方案1】:

在我的头撞墙很长一段时间后,我将 SubSonic.Core.dll 安装到 GAC 中。然后我从

中删除了 .dll
<#@ assembly name="SubSonic.Core.dll" #> 

改成

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

现在工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-26
    • 2011-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-02
    相关资源
    最近更新 更多