Error: Unable to find the requested .Net Framework Data Provider. It may not be installed

Having some issues deploying applications with ASP.NET MVC 3 and Entity Framework Code First using Microsoft SQL Server Compact Edition, even after I have installed on the server Microsoft SQL Server Compact Edition and Express.

Deploying ASP.NET MVC 3 with Entity Framework Code First you may have a few issues when deploying into a computer with only .NET 4 installed, I have to install MVC 3 dlls and Entity Framework CF to use the Compact Database.

This is the error you may get if you do not copy all the dlls.

[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
   System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +160
   System.Data.Entity.Infrastructure.SqlCeConnectionFactory.CreateConnection(String nameOrConnectionString) +168
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +158
   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.InternalSet`1.Initialize() +62
   System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +15
   System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TRes

 

Steps to fix the problem

You need System.Data.SqlServerCe.dll make sure in the properties you enable the local copy.

Add the provider to your web.config

<system.data> <DbProviderFactories> <remove invariant="System.Data.SqlServerCe.4.0" /> <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> </DbProviderFactories> </system.data>

 

Then you going to get this error, yet not to worry.

Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8482. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.

Now you should reference the dll System.Data.SqlServerCe.Entity.dll located in a private directory

C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private

Make sure you set the flag in the properties to copy it local, so gets deploy with all the dlls to the server that may not have that dll.

 

You may also get the error: Could not load file or assembly 'System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Still not having any success is running ASP.NET MVC 3 with Microsoft SQL Server Compact Edition 

Cheers

Al

Published Friday, May 27, 2011 7:13 PM by albertpascual
Filed under: ,

Comments

# re: Error: Unable to find the requested .Net Framework Data Provider. It may not be installed

Saturday, May 28, 2011 3:23 AM by adycrystal

Whether you need。

Gets into our website for a minute that uses you

http://www.fashionjeanshop.com

We are international trade. We offer grade a quality product only. Our products are authentic quality with original box .No matter what reason it is. buy from us will have much more confidence ! So, please don’t hesitate, just contact us for details! We will be your reliable business partner!

Hope you guys will enjoy by online shopping without much disturbances.

# re: Error: Unable to find the requested .Net Framework Data Provider. It may not be installed

Saturday, May 28, 2011 3:25 AM by adycrystal

http://www.fashionjeanshop.com

Jeans were first invented for the working man. It was quickly established that denim as a fabric is tough and hardens as it is put under pressure. For those people who worked under the sun and generally did a lot of menial work, the coming of jeans was a boon. Jeans did not require regular washing. They went on and on and were not needed to be discarded as they became worn out. In fact, the more worn the jeans, greater is its status. Soon, fashion designers across the world started using denim to produce various products. They fathomed the acceptance discount True Religion jeans has worldwide and made a killing out of producing designer jeans bearing their names.

# re: Error: Unable to find the requested .Net Framework Data Provider. It may not be installed

Saturday, May 28, 2011 3:26 AM by adycrystal

?????????????????

You know,Christian Louboutin Shoes is very fashion,you can not miss it.In this Christian Louboutin Sales season, you deserve to have a pair of beautiful shoes with Christian Louboutin.  http://www.heelsvogue.com . kindly visite our website,thanks!!!

Leave a Comment

(required) 
(required) 
(optional)
(required)