2012-07-18 56 views
1

我目前正在嘗試部署一個MVC 3應用程序我一直在我們的測試Web服務器上工作,並遇到一個主要問題加載一切正確。爲儘可能多地提供這方面的信息,我正在做一個bin部署(我已經發送了所有對本地複製的引用),並且正在通過文件系統將web項目上的基本發佈發佈到服務器。我使用的組件包括:無法部署MVC 3項目與實體框架4.3.1和Oracle ODAC

實體框架4.3.1 甲骨文ODAC 11.2.0(4.112.3.0版)

此應用程序有2個實體框架對象,一個去一個SQL Server數據庫和其他轉到Oracle 10g數據庫。我相信問題在於Entity Framework對象進入Oracle數據庫。這是我第一個MVC 3項目和我的第一個部署(這裏有很多「新」變量),所以我不確定是否缺少任何東西。我如何解決這個問題?在我的本地機器上,一切正常,只有當我將項目部署到服務器時,我纔有問題。

事情我試過到目前爲止:

我所有的控制器從基本控制器(BaseController),其中實體框架對象的實例生活繼承。我無法進入從BaseController繼承的任何控制器的Index視圖,但HomeController繼承自Controller。此頁面正常工作。我已經嘗試從其他控制器繼承,並允許我進入索引視圖,但返回到BaseController再次導致堆棧跟蹤中的錯誤。該錯誤在哪裏,我宣佈我的實體框架對象將在Oracle數據庫上線的情況發生:

protected internal RadixWebDataPRDX dbRadixData = new RadixWebDataPRDX(); 

我有Oracle.DataAccess.dll被複制,這還是引起了一個問題。

我的這個錯誤堆棧跟蹤低於感謝:在「/ RadixMVC」應用

服務器錯誤。

無法找到所需的.Net Framework數據提供程序。它可能沒有安裝。

描述:執行當前Web請求期間發生未處理的異常。請查看堆棧跟蹤以獲取有關該錯誤的更多信息以及源代碼的位置。

異常詳細信息:System.ArgumentException:無法找到請求的.Net Framework數據提供程序。它可能沒有安裝。

源錯誤:

在當前web請求的執行過程中生成未處理的異常。關於異常的來源和位置的信息可以使用下面的異常堆棧跟蹤來標識。

堆棧跟蹤:

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

[ArgumentException: The specified store provider cannot be found in the configuration, or is not valid.] 
    System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +63 
    System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +483 
    System.Data.EntityClient.EntityConnection..ctor(String connectionString) +77 
    System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString) +40 
    System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +17 
    RadixMVC.Models.Data.RadixWebDataPRDX..ctor() in C:\Users\862599\Documents\Visual Studio 2010\Projects\RadixMVC\RadixMVC\RadixMVC.Models.Data\RadixDataPRDX.Designer.cs:34 
    RadixMVC.Controllers.BaseController..ctor() in C:\Users\862599\Documents\Visual Studio 2010\Projects\RadixMVC\RadixMVC\RadixMVC\Controllers\BaseController.cs:17 
    RadixMVC.Controllers.AccountsPayableController..ctor() +29 

[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) +98 
    System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241 
    System.Activator.CreateInstance(Type type, Boolean nonPublic) +69 
    System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +67 

[InvalidOperationException: An error occurred when trying to create a controller of type 'RadixMVC.Controllers.AccountsPayableController'. Make sure that the controller has a parameterless public constructor.] 
    System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +181 
    System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +77 
    System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +66 
    System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +209 
    System.Web.Mvc.<>c__DisplayClass6.<BeginProcessRequest>b__2() +50 
    System.Web.Mvc.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() +13 
    System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7 
    System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +23 
    System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 func) +124 
    System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +98 
    System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48 
    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970356 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184 

版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.272

+0

您是否在測試Web服務器上安裝了ODAC? – 2012-07-18 15:22:01

+0

我不相信。它需要成爲?或者我只需要DLL文件來引用它? – 2012-07-18 15:28:31

回答

1

解決方案就是Bob說的。 ODAC組件也必須安裝在服務器上(我不知道)。感謝Bob!