我有一个带有Entity Framework Data项目和MVC网站的Visual Studio 2010解决方案。在调试时,该网站在IDE中运行良好,但是当部署到IIS中的自己的站点(甚至是我的本地IIS实例)时,它在任何视图中都无法访问提供程序。 CNR.HARPS.DATA
是带有.edmx文件的数据项目。我只是看不出为什么它在IDE中工作,但在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
[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
答案 0 :(得分:3)
我发现了这个问题。在IIS 7应用程序池中,我必须将Enable 32-Bit Applications设置为true。