开发者

Entity Framework and Unable to find the requested .Net Framework Data Provider

I have a Visual Studio 2010 solution with an Entity Framework Data project and a MVC web site. The website works fine in the IDE when debugging, but when deployed to its own site in IIS (Even my local instance of IIS) it fails at any view hitting the provider. CNR.HARPS.DATA is the data project with the .edmx file. I just cannot see why it works in the IDE but not when running in IIS iteself.

[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
   System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +251
开发者_Go百科
[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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜