2015-06-10 44 views
0

我在IIS上遇到了引用我的Oracle數據連接的錯誤500。我附加了堆棧跟蹤。我已驗證我已安裝Oracle Client,並且這些DLL都存在於應用程序目錄中。我使用IIS 8.0運行Windows Server 2012。附件是我的堆棧跟蹤...Oracle.DataAccess.Client.OracleConnection異常IIS 500錯誤

{"Message":"An error has occurred.","ExceptionMessage":"The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.","ExceptionType":"System.TypeInitializationException","StackTrace":" at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)\r\n at CECC.AMI.Controllers.getBlinksController.getAMIData(String startDateString, String endDateString)\r\n at CECC.AMI.Controllers.getBlinksController.getBlinks(String startDate, String endDate)\r\n at lambda_method(Closure , Object , Object[])\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()","InnerException":{"Message":"An error has occurred.","ExceptionMessage":"The provider is not compatible with the version of Oracle client","ExceptionType":"Oracle.DataAccess.Client.OracleException","StackTrace":" at Oracle.DataAccess.Client.OracleInit.Initialize()\r\n at Oracle.DataAccess.Client.OracleConnection..cctor()"}} 

我敢肯定,我已經得到SOMETHING配置錯誤。基本上我希望這個網站能夠從開發移動到生產,並且我已經將Oracle.DataAccess的參考設置爲複製本地,並且它複製到bin文件夾,所以我的理解是它應該引用該dll而不是服務器上的任何東西。然而,我確實在11g版本的服務器上安裝了客戶端,因此我可能會引用該錯誤。 這是在64位版本的服務器12上運行的32位應用程序。

回答

1

對於您安裝的Oracle客戶端版本,您正在使用不兼容的提供程序。這就是張貼的堆棧跟蹤說,隨着指出以下

"ExceptionMessage":"The provider is not compatible with the version of Oracle client" 

檢查config文件,並相應糾正。

+0

對,但設置「複製本地」,不應該允許它是自包含的?當我從Visual Studio運行該提供程序時,該提供程序工作,但在發佈到開發計算機時無法運行。 – 0perator

+1

@OP:如果您的DEV機器已經有GAC中提供的Oracle dll,那麼將使用這些代替「本地」dll。至少我認爲這是如何運作的。 – sstan

相關問題