asp.net - 无法找到请求的.Net Framework 数据提供程序。它可能没有安装

标签 asp.net asp.net-mvc asp.net-mvc-3 deployment

完成 ASP.NET MVC 3 教程(查找 here )后,我尝试在线发布该应用程序。我联系了托管公司,以确定是否可以托管 MVC 3 应用程序。我必须对(dll 文件)应用程序进行 bin 部署。因此,在执行 hanselmans blog 上的一些步骤之后,我陷入了以下错误:

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.InternalSet1.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, IDictionary2 parameters) +188
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27

感谢任何帮助。

最佳答案

根据我的经验,该错误意味着 web.config 中连接字符串上的 providerName 属性的值不正确,或者提供程序字面上不正确安装。如果您的 providerName 设置为 System.Data.SqlServerCe.4.0 (SQL Server Compact)(这在开发中并不罕见),我可以向您保证它没有安装在您的计算机上虚拟主机;它仅在 Visual Studio 中用于开发。您可能只需将其更改为真正的 SQL Server 提供程序:System.Data.SqlClient

关于asp.net - 无法找到请求的.Net Framework 数据提供程序。它可能没有安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16165158/

相关文章:

c# - 使用 HTMLEditorExtender 的文本框在按 Enter 时不会插入新行

asp.net - Ajax.ActionLink无法正常工作,Response.IsAjaxRequest()始终为false

c# - 让 jqGrid 使用不同的页面来查看一行

c# - 每次应用程序运行时如何在数据库中播种特定值?

c# - 如何获取 Hotmail 联系人电子邮件地址?

c# - 使用 ValidationProperty 属性防止 UserControl 的完整回发

c# - 在 DataBound 事件中向 DropDownList 添加属性?

asp.net - aspnet-core web api 的基于 token 的身份验证

sql - 使用 linq mvc 的 CTE 递归查询

c# - HTML 解码和编码