Entity Framework and could not find the requested .Net Framework data provider

I have a Visual Studio 2010 solution with an Entity Framework Data project and an MVC website. The website works fine in the IDE when debugging, but when deployed to its own site in IIS (even in my local IIS instance) it doesn’t work for any view that hits the provider. CNR.HARPS.DATAis a data project with a .edmx file. I just don’t understand why it works in the IDE, but not when working in IIS.

[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
   System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +251

[ArgumentException: The specified store provider cannot be found in the configuration, or is not valid.]
   System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +10983191
   System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +641
   System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +84
   CNR.HARPS.ENTITIES.HARPSDataModel..ctor() in D:\GAP.CONVERSION\CNR.HARPS\Dev\CNR.HARPS\CNR.HARPS.DATA\HARPS.Context.cs:23
   CNR.HARPS.DATA.FeeOwnerRepository..ctor() in D:\GAP.CONVERSION\CNR.HARPS\Dev\CNR.HARPS\CNR.HARPS.DATA\Repositories\FeeOwnerRepository.cs:22
   CNR.HARPS.WEB.CONTROLLERS.FeeOwnerController..ctor() in D:\GAP.CONVERSION\CNR.HARPS\Dev\CNR.HARPS\CNR.HARPS.WEB\Controllers\FeeOwnerController.cs:31

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +117
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +247
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +106
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +84
+3
source share
1 answer

I found a problem. In the IIS 7 application pool, I had to set Enable 32-Bit Applications to true.

+3
source

All Articles