我正在關注ASP.NET MVC 3音樂商店應用程序教程,但我一直陷入第4部分:http://www.asp.net/mvc/tutorials/mvc-music-store-part-4。它不斷告訴我,我沒有安裝SQL數據提供:無法找到請求的.Net Framework數據提供程序。它可能沒有安裝。 - 當遵循mvc3 asp.net教程
確切錯誤:
System.ArgumentException was unhandled by user code
Message=Unable to find the requested .Net Framework Data Provider. It may not be installed.
Source=System.Data
StackTrace:
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at MusicApplication.Controllers.StoreController.Index() in C:\Users\Michelle\documents\visual studio 2010\Projects\MusicApplication\MusicApplication\Controllers\StoreController.cs:line 18
at lambda_method(Closure , ControllerBase , Object[])
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
InnerException:
我已經加入了參考System.Data.SqlServerCe - 仍然有同樣的錯誤。任何指導將非常感謝
我會檢查拼寫,並確保它是'System.Data.SqlServerCe.4.0'。如果您還沒有安裝它,也http://www.microsoft.com/download/en/details.aspx?id=17876。 – Buildstarted
是的拼寫正確.. – michelle
您是否嘗試過重新安裝SQL Server CE?過去我曾經遇到過很多問題,即使是修理也不行。卸載(如果您使用的是64位操作系統,則爲32位和64位版本)並重新安裝。 –