简体   繁体   中英

Oracle.DataAccess.Client.OracleConnection Exception IIS 500 Error

I'm getting an error 500 on IIS that references my Oracle Data Connections. I've attached the stack trace. I've verified that I have Oracle Client installed and the DLLs all exist within the application directory. I'm running Windows Server 2012 with IIS 8.0. Attached is my stack trace...

   {"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()"}}

I'm sure I've got SOMETHING configured wrong. Basically I want this site to be able to be moved around from dev to production and I've set my reference of Oracle.DataAccess to copy local and it does copy to the bin folder so my understanding is that it should be referencing that dll not anything on the server. I do however have the client installed on the server at version 11g so perhaps I'm referencing that wrong. This is a 32bit application running on a 64 bit version of Server 12.

You are using an incompatible provider for the version of Oracle client you have installed. That's what the posted stack trace says as pointed below

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

Check your config file and correct it accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM