Could not find the requested .Net Framework data provider. It cannot be installed.

After completing ASP.NET MVC 3 (found here ), I tried to publish the application on the Internet. I contacted the hosting company to make sure that MVC 3 applications can be hosted. But I had to deploy the application (dll files). So after the following steps in the hanselmans blog , I am stuck with the following error:

Could not find the requested .Net Framework data provider. It cannot be installed. Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information about the error and where it appeared in the code.

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework data provider. It cannot be installed.

Source Error:

An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of the exception can be identified using the exception stack trace below.

Stack trace:

[ArgumentException: Unable to find the requested .Net Framework Provider data. It cannot be installed.]
System.Data.Common.DbProviderFactories.GetFactory (String providerInvariantName) +1420503
System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig (String name) +362
System.Data.Entity.Internal.LazyInternalConnection.Initialize () +49
System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel () +10 System.Data.Entity.Internal.LazyInternalContext.InitializeContext () +265 System.Data.Entity.Internal.InternalContext.GetEntityTpeTTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTetTeTetTetTetTetTeTetTeTetTetTeTetTetTeTetTeTetTeTetTeTetTeTetTetTypeTetTypeTetA
System.Data.Entity.Internal.Linq.InternalSet 1.Initialize() +62
System.Data.Entity.Internal.Linq.InternalSet
1.Initialize() +62
System.Data.Entity.Internal.Linq.InternalSet
1.Initialize() +62
System.Data.Entity.Internal.Linq.InternalSet
1.get_InternalContext () +15 System.Data.Entity.Infrastructure.DbQuery 1.System.Linq.IQueryable.get_Provider() +37 System.Linq.Queryable.OrderByDescending(IQueryable source, expression 1 keySelector) +66
MvcMusicStore.Controllers.HomeController.GetTopSellingAlbums(Int32 count) +420 MvcMusicStore.Controllers.HomeController.Index() +47
lambda_method(Closure , ControllerBase , Object[] ) +40
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
1 keySelector) +66
MvcMusicStore.Controllers.HomeController.GetTopSellingAlbums(Int32 count) +420 MvcMusicStore.Controllers.HomeController.Index() +47
lambda_method(Closure , ControllerBase , Object[] ) +40
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
1 keySelector) +66
MvcMusicStore.Controllers.HomeController.GetTopSellingAlbums(Int32 count) +420 MvcMusicStore.Controllers.HomeController.Index() +47
lambda_method(Closure , ControllerBase , Object[] ) +40
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
2 parameters) +188
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27

Any help is appreciated.

+6
source share
5 answers

From my experience, this error means that the value of the providerName attribute in the connection string in your web.config is either incorrect or the provider is literally not installed. If your providerName installed on System.Data.SqlServerCe.4.0 (SQL Server Compact), which is not uncommon in development, I can guarantee that it is not installed on your web host; it is used only in Visual Studio for development. You probably just need to change it to the real SQL Server provider: System.Data.SqlClient .

+11
source

I solved the problem.

I find a space in the name of the provider. Therefore, the .net infrastructure cannot use the database connection string.

Check the attribute value of the connectionString tag. Your supplier name may not be specified. do not allow space or extra characters in the value of providerName.

+2
source

I ran into a similar problem .. and there is a very funny solution for this. Just peek into your ConnectionString. If this is the same that you used for other ASP.Net applications, then this should not be. Entity Framework has a completely different case

 <add name="EmployeeContext" connectionString="Server=.\SQLEXPRESS;Database=DB1;User Id=user1;password=password1;" providerName="System.Data.SqlClient**;**" /> 

Change it to -

 <add name="EmployeeContext" connectionString="Server=.\SQLEXPRESS;Database=DB1;User Id=user1;password=password1;" providerName="System.Data.SqlClient"/> 

Can you tell the difference ... only one small one - No! '; at the end of ProviderName .. Yes, and that matters. It should be the same with the same ProviderName copy, although I did not check case sensitivity. But that solved my problem.

0
source

Another data point ...

I work with Oracle and Entity Framework. I installed Oracle ODP.NET, Managed Driver, to deal with this problem. In NuGet Package Manager, type

 Install-Package Oracle.ManagedDataAccess 

It will update App.config with related build information and DbProviderFactories. I am using VS 2015, Entity Framework 6. I also have Oracle Developer Tools installed.

0
source

The error was perfect, and the comments above were good, but in my case, I literally incorrectly indicated the provider in the web.config file: System.Data.SqlClinet is not System.Data.SqlClient

0
source

All Articles