Oracle.DataAccess.Client.OracleConnection Exception IIS 500
本文关键字:IIS Exception OracleConnection DataAccess Client Oracle | 更新日期: 2023-09-27 17:54:50
我在引用Oracle数据连接的IIS上得到一个错误500。我附加了堆栈跟踪。我已经验证了我已经安装了Oracle Client,并且dll都存在于应用程序目录中。我运行的是Windows Server 2012和IIS 8.0。附件是我的堆栈跟踪…
{"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()"}}
我确定我有一些配置错误。基本上,我希望这个网站能够从开发到生产移动,我已经设置了我的Oracle参考。数据访问复制本地,它确实复制到bin文件夹,所以我的理解是,它应该引用的dll不是服务器上的任何东西。然而,我确实有客户端安装在11g版本的服务器上,所以也许我引用的是错误的。这是一个运行在64位版本的Server 12上的32位应用程序。
您所安装的Oracle
客户端版本使用了不兼容的提供程序。这就是
"ExceptionMessage":"The provider is not compatible with the version of Oracle client"
检查你的config
文件并相应地修改