2011-06-17 62 views
3

我有一個Visual Studio 2010解決方案與實體框架數據項目和MVC網站。該網站在調試時可以在IDE中正常工作,但在IIS中部署到自己的站點時(甚至是本地IIS實例),它在任何視圖都會觸發提供程序時失敗。 CNR.HARPS.DATA是.edmx文件的數據項目。我只是不明白爲什麼它在IDE中工作,但不能在IIS中運行。實體框架和無法找到請求的.Net框架數據提供程序

[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 
+2

你在使用什麼提供商? SQLCE? – Patrik

+0

你使用SQLite嗎?在這種情況下,您可能會錯過對數據庫提供程序工廠的引用。 –

+0

請發送連接字符串 – Andiih

回答

3

我發現了這個問題。在IIS 7應用程序池中,我必須將啓用32位應用程序設置爲true。

+0

已經這樣做,沒有雪茄! –

相關問題