VS 2010 中的 T4 模板找不到 Metada 文件 SubSonic.Core.dll

发布于 2024-09-17 11:26:24 字数 1020 浏览 2 评论 0原文

我正在使用 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项目(我已经下载了代码)。 SubSonic 没有安装在 GAC 中,但 DAL 项目正在生成这样的代码文件。

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

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

编辑 2:- 我通过添加解决了这个问题<#@ assembly name="SubSonic.Core.dll" #> 按照我的 这个问题,但那是在 VS 2008 中。不知道为什么这在 VS 2010 中不起作用。

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

I am using Subsonic 3 to generate DAL. Further I am using T4 templates to generate my BOs from DAL. Subsonic's T4 templates are working properly, but when I run my templates it gives me following error:

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

I have imported SubSonic in my settings.include file like this:

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

I am referring SubSonic.Core project (I've downloaded code). SubSonic is not installed in GAC, but DAL project is generating code just file like this.

EDIT 1:- If I remove <#@ assembly name="SubSonic.Core.dll" #> it new error crops up:

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

EDIT 2:- I have got solution to this problem by adding <#@ assembly name="SubSonic.Core.dll" #> as suggested in answer to my this question, but that was in VS 2008. Don't know why this is not working in VS 2010.

EDIT 3:- Installed SubSonic.Core.dll to GAC, restarted VS, still getting the freaking error. Should have slept instead.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南街九尾狐 2024-09-24 11:26:24

在苦苦挣扎了很长一段时间后,我将 SubSonic.Core.dll 安装到了 GAC 中。然后我删除了 .dll

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

并将其更改为

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

现在工作正常。

After beating my head against the wall for quite a long time, I installed SubSonic.Core.dll into GAC. Then I removed .dll from

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

and changed it to

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

now working fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文