Wednesday, September 07, 2011 5:45 PM
I have attempted to use the new Universal Providers by down loading it from NuGet in a test project. The project is very simple: it contains a Login control. It works in my development system, but when I publish it I get an error: "Unable to find the requested .Net Framework Data Provider. It may not be installed." I have published the test page to two different host providers with the same result.
The web.config contains the following element:
<connectionStrings> <add name="Sql_CE" connectionString="Data Source=|DataDirectory|\Toys.sdf" providerName="System.Data.SqlServerCe.4.0"/> </connectionStrings>
This is the only place in the web.config that the providerName is mentioned. There is nothing in my web.config file about dbProviderFactories. Here are the first few lines from the stack trace.
Stack Trace: [ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.] System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1415431 System.Web.Providers.Entities.ModelHelper.CreateEntityConnection(ConnectionStringSettings setting, String csdl, String ssdl, String msl) +295 System.Web.Providers.Entities.ModelHelper.CreateMembershipEntities(ConnectionStringSettings setting) +82 System.Web.Providers.DefaultMembershipProvider.GetPasswordWithFormat(String applicationName, String userName, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& format, String& salt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +232 System.Web.Providers.DefaultMembershipProvider.CheckPassword(String userName, String password, Boolean updateLastActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +210 System.Web.Providers.DefaultMembershipProvider.CheckPassword(String userName, String password, Boolean updateLastActivityDate, Boolean failIfNotApproved) +74
I have been fighting this problem for several weeks and hope you can shed some light as to the source of my problem. If you want to see the entire stack trace goto: http://dev.lemmedata.com. To produce the error enter anything for the User Name and Password. Thanks in advance for your assistance.
- Edited by GrandpaB Wednesday, September 07, 2011 5:47 PM
Thursday, September 08, 2011 5:50 PM
Can you confirm that you have System.Data.SqlServerCe.4.0 regsitered as a valid ADO.NET provider in web.config. If not, you might have to add this entry -
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=126.96.36.199, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
“This posting is provided "AS IS" with no warranties, and confers no rights”.
Friday, September 09, 2011 2:28 PM
Many thanks for your input. That was the last piece in the solution!!!
I can’t tell you how frustrating this problem has been. I developed a website on my development system using VWD 2010 Express, SQL Server Compact 4.0 and ErikEJ’s SqlCeMembershipProvider. It was ready to be deployed on June 20<sup>th</sup>.
Then the fun began. I have opened several threads on these forums attempting to solve the problem. One reply I received suggested that my hosting provider did not correctly support SQLCE. I opened an account with a second hosting provider and received the same error. I of course did not have all the required .dll files or the Microsoft.VC90.CRT files. Various suggestions in the course of solving the problem got those dependent files installed in the project. When I found the Universal Providers I attempted that as a solution. Your suggestion to add the <DbProviderFactories> entry in the web.config file was suggestion that finally brought it all together.
In my frustration to get the website published, I have been investigating Drupal, Orchard and WebMatrix.
May I suggest that the NuGet downloads for both the ErikEJ SqlCeMembershipProvider and the ASP.Net Universal Providers be modified to make their installation easier? They both modify the web.config file, why can’t they add the <DbProviderFactories> element? Why can’t they add the appropriate .dll and the Microsoft.VC90.CRT files? It is of course obvious that I do not have the required expertise or I wouldn’t have been in this pickle. If automatically adding these files is too difficult, the minimum improvement would be to add a text file with instruction on how to complete the installation. The effort to improve the NuGet downloads will be appreciated by all those programmers who are not highly proficient.
To Imran, and all the others who have patiently attempted to help me get this problem solved, thanks again.
PS I will attempt to go back to all the previous threads that I created on this subject and add this reply.
Friday, March 23, 2012 5:27 PMI fixed this problem by just copying and pasting in the example code -- I had an extra space or some typo that I couldn't see apparently.