MySQL T4 模板错误:元数据文件“MySql.Data” 找不到
D:\Web\CityV2\App_Code\ActiveRecord.tt(0,0) :错误 CS0006:编译转换:找不到元数据文件“MySql.Data”
首先让我说我正在使用 VWD 2008 Express。
这些是我到目前为止所采取的步骤:
- 创建了一个全新的项目
- 添加了 Subsonic.Core.dll 和 MySql.Data.dll 的引用
- 将 Active Record 模板复制到项目
- 更改了所有 <#@ include file="SQLServer.ttinclude" #> 到 <#@ include file="MySQL.ttinclude" #>
- 从TemplateProviders文件夹复制MySQL.ttinclude和Settings.ttinclude
- 使用我的连接字符串和数据库信息更新Settings.ttinclude
- 更新Settings.ttinclude并根据ranomore 的说明
- 尝试从模板构建代码并收到错误,
然后我意识到我没有在我的开发盒上“安装”了 MySql Connector(即使我添加了对 bin 的引用)。 因此,我前往 MySQL.com 并下载了最新的 6.0.4 连接器 msi 并安装了它(GAC)。 错误不再出现,但其他任何东西也没有出现:没有新类,没有新错误,什么都没有[是的,我在运行命令后刷新了项目;-)]。
两件事:
- 我是否在某个地方错过了一步?
- 有没有一种方法可以在不需要将 MySQL 安装到 GAC 的情况下构建模板?
D:\Web\CityV2\App_Code\ActiveRecord.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'MySql.Data' could not be found
Let me start by saying I'm using VWD 2008 Express.
These are the steps I've taken so far:
- Created an entirely new project
- Added references for Subsonic.Core.dll and MySql.Data.dll
- Copied Active Record templates to project
- Changed all <#@ include file="SQLServer.ttinclude" #> to <#@ include file="MySQL.ttinclude" #>
- Copied the MySQL.ttinclude and Settings.ttinclude from the TemplateProviders folder
- Updated Settings.ttinclude with my connectionstring and database information
- Updated the Settings.ttinclude and created the external tool mapping as per ranomore's instructions
- Attempted to build the code from the templates and received the error
I then realized that I didn't have MySql Connector "installed" on my dev box (even though I added a reference to the bin). So I proceeded to MySQL.com and downloaded the latest 6.0.4 connector msi and installed it (GAC). The error no longer appears, but neither does anything else: no new classes, no new errors, nothing [and yes, I refreshed the project after running the command ;-)].
Two things:
- Am I missing a step somewhere?
- Is there a way build the templates without needing MySQL installed to the GAC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,SubSonic 3 不支持 VWD 2008 Express(或更具体地说,VWD 不支持 t4)。 拉诺莫尔提出了一种解决方法,但需要您做一些工作。 有关更多详细信息,请参阅以下问题:
SubSonic ASP.NET Visual Web Developer Express 中的 MVC 示例
编辑:我应该正确阅读您的问题,您显然已经有了上面的链接。 也许值得您下载试用一下VS professional,看看你是否有更好的运气,看看是否值得花现金购买它。
顺便说一句,如果您想免费获得 msdn 订阅,您应该考虑注册 bizspark计划
Unfortunately SubSonic 3 doesn't support VWD 2008 Express (or more specifically VWD doesn't support t4). There is a sort of workaround that ranomore came up with but it will require some work by you. See the following question for more details:
SubSonic ASP.NET MVC sample in Visual Web Developer Express
EDIT: I should have read your question properly you obviously already have the link above. Maybe worth your while downloading the trial of VS professional and seeing if you have more luck with that to see if it's worth outlaying the cash to buy it.
On a side note if you're looking to get an msdn subscription for free you should have a look into registering for the bizspark program