无法找到所请求的.Net框架数据提供程序。它可能没有安装 [英] Unable to find the requested .Net Framework Data Provider. It may not be installed

查看:213
本文介绍了无法找到所请求的.Net框架数据提供程序。它可能没有安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完成ASP.NET MVC 3(查找这里),我试图在线发布该应用程序。我联系了托管公司,以确定是否可以托管MVC 3应用程序。但我不得不bin部署(dll文件)应用程序。因此,在 hanselmans博客上执行以下步骤后,我遇到以下错误: / p>


无法找到所请求的.Net框架数据提供者。它可能没有安装。
说明:在执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误的更多信息及其在代码中的位置。



异常详细信息:System.ArgumentException:无法找到
请求.Net框架数据提供者。它可能不会被安装。



源错误:



在$执行期间生成了一个未处理的异常b $ b当前Web请求。关于
的起点和位置的信息,可以使用下面的异常堆栈跟踪来识别。



堆栈跟踪:



[ArgumentException:无法找到请求的.Net框架数据
提供程序。可能没有安装。]

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.GetEntitySetAndBaseTypeForType(Type
entityType)+17 < br>
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系统。 Linq.Queryable.OrderByDescending(IQueryable
1来源,表达式 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个参数)+188

System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
controllerContext,ActionDescriptor actionDescriptor,IDictionary`2
参数)+27


任何帮助都不胜感激。

providerName 属性的值不正确,或者提供者字面上未安装。如果您的 providerName 设置为 System.Data.SqlServerCe.4.0 (SQL Server Compact),这并不罕见开发,我可以保证您没有安装在您的网络主机上;它只在Visual Studio中用于开发。您可能只需要将其更改为真正的SQL Server提供程序: System.Data.SqlClient


After completing the ASP.NET MVC 3 (find here), I tried to publish the app online. I contacted the hosting company to be sure if it's possible to host MVC 3 apps. But I had to bin deploy the (dll files) application. So after following some steps on hanselmans blog, I'm getting stuck on following error:

Unable to find the requested .Net Framework Data Provider. It may not be installed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding 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 Data Provider. It may not 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.GetEntitySetAndBaseTypeForType(Type entityType) +17
System.Data.Entity.Internal.Linq.InternalSet1.Initialize() +62
System.Data.Entity.Internal.Linq.InternalSet
1.get_InternalContext() +15 System.Data.Entity.Infrastructure.DbQuery1.System.Linq.IQueryable.get_Provider() +37 System.Linq.Queryable.OrderByDescending(IQueryable1 source, Expression1 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.

解决方案

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

这篇关于无法找到所请求的.Net框架数据提供程序。它可能没有安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆