subsonic 3.0.0.3与mysql无法在.net 4.0中工作? [英] subsonic 3.0.0.3 with mysql can not work in .net 4.0?
问题描述
我已经安装了vs2010 beta2,创建了一个MVC网站,我想使用subsoinc访问 SimpleRepository 中的mysql数据库,当运行该网站时,出现错误:"无法找到请求的.Net Framework数据提供程序.可能未安装..
i have installed vs2010 beta2, create a MVC website, i want to use subsoinc access a mysql database in SimpleRepository, when run the website, i get error: "Unable to find the requested .Net Framework Data Provider. It may not be installed. ".
var repo = new SimpleRepository("NorthwindMySql", SimpleRepositoryOptions.None);
var user = repo.Find<Models.User>(u => u.Username == "mm");
ViewData["UserData"] = user;
然后,我用我的vs2008做同样的事情,这次,该网站运行正常. 我怎样才能解决这个问题?谢谢.
then, i use my vs2008 do the same thing, this time, the website works just fine. how can i fix this? thanks.
推荐答案
可能需要将其添加到web.config文件中:
It is possible that you need to add this to your web.config file:
< system.data> < DbProviderFactories> <添加名称="MySQL数据提供程序" invariant ="MySql.Data.MySqlClient" description =.MySQL的.Net框架数据提供程序" type ="MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data,Version = 6.2.3.0 ,文化=中立,PublicKeyToken = c5687fc88969c44d"/gt; </DbProviderFactories> </system.data>
<system.data> <DbProviderFactories> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data>
因为MySQL驱动程序未在.NET 4 machine.config中注册(仅在安装MySQL连接驱动程序之后才安装.NET 4).
as the MySQL driver didn't register with the .NET 4 machine.config (.NET 4 was installed only after the MySQL connectivity drivers were installed).
请注意,您拥有的MySQL驱动程序版本可能会有所不同.
Notice that the version of the MySQL driver you have may vary.
这篇关于subsonic 3.0.0.3与mysql无法在.net 4.0中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!