subsonic 3.0.0.3 with mysql can not work in .net 4.0?

半世苍凉 提交于 2019-12-11 06:27:44

问题


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;

then, i use my vs2008 do the same thing, this time, the website works just fine. how can i fix this? thanks.


回答1:


It is possible that you need to add this to your web.config file:

<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>

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).

Notice that the version of the MySQL driver you have may vary.



来源:https://stackoverflow.com/questions/2062189/subsonic-3-0-0-3-with-mysql-can-not-work-in-net-4-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!