I know that there were many other reports of this error, but no one was able to shed light or help on my problem. I use a direct connection to SqlExpress, so there are no special Oracle or MySQL databases or anything else. Looks like it should just fit like a glove.
So the scenario is this: I created a solution consisting of several projects; Repositories, data (EF5.0), utilities, test project, and MVC web application. The goal is simply to access the underlying SQL Express database through the data classes through the repositories in the Warehouse project using EF5 and some repositories from the test project and the MVC application.
The testing project works and can easily receive and update the database.
However, the MVC web project throws "Unable to find the requested .Net Framework data provider. It may not be installed." an error that I do not understand, because it uses the same connection string as the test project.
[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.] System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1426271 WebMatrix.Data.DbProviderFactoryWrapper.CreateConnection(String connectionString) +64 WebMatrix.Data.<>c__DisplayClass15.<OpenConnectionStringInternal>b__14() +16 WebMatrix.Data.Database.get_Connection() +19 WebMatrix.Data.Database.EnsureConnectionOpen() +12 WebMatrix.Data.Database.QueryValue(String commandText, Object[] args) +63 WebMatrix.WebData.DatabaseWrapper.QueryValue(String commandText, Object[] parameters) +14 WebMatrix.WebData.SimpleMembershipProvider.GetUserId(IDatabase db, String userTableName, String userNameColumn, String userIdColumn, String userName) +232 WebMatrix.WebData.SimpleMembershipProvider.ValidateUserTable() +85
I have...
- Register System.Data.SqlClient in the web.config file.
- Checked that a registered version (2.0.0.0) of System.Data exists in the GAC for this article.
- Make sure there are no typos in the connection string.
Here is what I have in web.config ...
<connectionStrings> <add name="DBCatalogContext" connectionString="metadata=res://*/DBCatalog.csdl| res://*/DBCatalog.ssdl| res://*/DBCatalog.msl; provider=System.Data.SqlClient; provider connection string="data source=.\SQLEXPRESS; initial catalog=DBCatalog; integrated security=True; multipleactiveresultsets=True; App=EntityFramework"" providerName="System.Data.EntityClient" /> </connectionStrings> <system.data> <DbProviderFactories> <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </DbProviderFactories> </system.data>
The only thing I see that it makes no sense to me when I select the "System.Data" link in the "Links" folder and look at the properties that it says that it is version 4.0.0.0, but when I change the version in the section "DbProviderFactories" on the configuration site, I still get the error. Also, I donβt even see the link to this library in the Test project, which works.
I am sure that this is supervision or that I am missing any configuration settings, but I do not know where else to look at this point, so any help would be appreciated.
Thanks G