VS 2010 中的 T4 模板找不到 Metada 文件 SubSonic.Core.dll
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在苦苦挣扎了很长一段时间后,我将 SubSonic.Core.dll 安装到了 GAC 中。然后我删除了 .dll
并将其更改为
现在工作正常。
After beating my head against the wall for quite a long time, I installed SubSonic.Core.dll into GAC. Then I removed .dll from
and changed it to
now working fine.