Could not find the requested .Net Framework data provider. It cannot be installed. - in the next mvc3 asp.net manual

I follow the tutorial on the application in the ASP.NET MVC 3 store, but I continue to get stuck in part 4: http://www.asp.net/mvc/tutorials/mvc-music-store-part-4 . He continues to tell me that I do not have an installed SQL data provider:

Exact error:

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: 

I added a link to System.Data.SqlServerCe - still has the same error. Any guidance would be truly appreciated.

+44
sql-server asp.net-mvc asp.net-mvc-3 dataprovider
Jul 28 '11 at 20:27
source share
8 answers

I managed to solve a problem like this in Visual Studio 2010 using NuGet.

Go to Tools> Library Package Manager> Manage NuGet packages to solve ...

In the dialog box, find "EntityFramework.SqlServerCompact". You will find the package that describes "Allows you to use SQL Server Compact 4.0 with the Entity Framework." Install this package.

An element similar to the following will be inserted into your web.config:

 <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework"> <parameters> <parameter value="System.Data.SqlServerCe.4.0" /> </parameters> </defaultConnectionFactory> </entityFramework> 
+29
Aug 10 2018-12-12T00:
source share

I had the same problem. I checked the version of System.Data.SqlServerCe in C: \ Windows \ assembly. It was 3.5.1.0. So I installed version 4.0.0 from below link (x86) and it works fine.

http://www.microsoft.com/download/en/details.aspx?id=17876

+16
Apr 25 2018-12-12T00:
source share

Add these lines to the web.config file:

 <system.data> <DbProviderFactories> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/> </DbProviderFactories> </system.data> 

Change the provider from MySQL to SQL Server or any other database provider that you are connecting to.

+10
Apr 04 '13 at
source share

This error is mainly related to the incompatibility of the processor architecture with the installed Framework ei x86 vs x64 Solution: Go to the explorer solution> project properties> Compile tab> Advanced compilation options There you need to change the target processor from X64 to X86 Save the new settings and recompile the solution. I tried it and it worked out very well. Hope this helps you. Malek

+1
Jul 10 '17 at 7:35
source share

In my case, the problem was caused by a problem connecting to the SQL database. I just disconnected and then reconnected the SQL data source from the project view. I'm working again. Hope this works for everyone.

0
Jul 18 2018-12-18T00:
source share

I had a similer problem with SqlClient in a WCF service. My solution was to put these lines in client app.config

  <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> </startup> 

Hope this helps someone.

0
Sep 10 '12 at 9:15
source share

This happened to me because I created a new project that tried to use System.Web.Providers DefaultMembershipProvider for membership. My database and application were configured to use System.Web.Security.SqlMembershipProvider . I had to update the provider and connection string (as this provider has some weird connection string requirements) to make it work.

0
Mar 12 '14 at 0:30
source share

I had the same thing, following the MvcMusicStore tutorial in part 4 and replacing this String connection with this:

add name = "MusicStoreEntities" connectionString = "data source =. \ SQLEXPRESS; Integrated Security = SSPI; database = MvcMusicStore; User ID = sa; password =" ProviderName = "System.Data.SqlClient" / ">

It worked for me.

0
Oct 07 '14 at 5:07
source share



All Articles