Oracle.DataAccess.Client.OracleConnection异常IIS 500错误

时间:2015-06-10 14:12:13

标签: c# .net oracle iis oracle11g

我在IIS上收到引用我的Oracle数据连接的错误500。我已经附加了堆栈跟踪。我已经验证我安装了Oracle客户端,并且DLL都存在于应用程序目录中。我正在运行带有IIS 8.0的Windows Server 2012。附件是我的堆栈跟踪...

   {"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 配置错误。基本上我希望这个站点能够从dev移动到生产,我已经设置了Oracle.DataAccess的引用来复制本地,它会复制到bin文件夹,所以我的理解是它应该引用那个dll而不是服务器上的任何东西。但是我确实在服务器上安装了版本为11g的客户端,所以也许我引用了那个错误。 这是在64位版本的Server 12上运行的32位应用程序。

1 个答案:

答案 0 :(得分:1)

您正在为已安装的Oracle客户端版本使用不兼容的提供程序。这就是发布的堆栈跟踪所指的内容,如下所示

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

检查您的config文件并进行相应更正。