3

I've developed a simple C#, .net 4.0 website which I'd like to deploy onto an IIS test server. I am using the Oracle.DataAccess assembly to connect to an Oracle database, and I've added that DLL (and a hell of a lot of other related DLL's, just for good measure and in a shotfun attempt to try and solve this problem), to the bin folder of my website. it works fine on my development machine (obviously; worked fine before copying all of those DLLs), but not my test server. On the test server I receive the following exception:

[OracleException (0x80004005)]
   Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) +1468
   Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) +24
   Oracle.DataAccess.Client.OracleConnection.Open() +4391
   MappingQueries.connect() +173
   scripts_list_mappings.Page_Load(Object sender, EventArgs e) +17
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

No error message, no specifics. Is there some way I can get more information, or could there be some solution to this problem? I'm at a bit of a loose end here, so any useful information would be greatly appreciated.

The Solution (sort of)

Okay, I've fixed this in a roundabout way, and I'd like to leave a few suggestions for whoever comes up against a similar problem.

First things first: it helped me to have a simple test application which I could use to determine if the problem was IIS. I used a simple C# application that connected to my Oracle database. My aim was to get that to work properly, which I did so by installing the Oracle instant client.

Next step: run the application using a privileged account. I used my own administrative account, which I had run my test application with.

Finally, to determine whether this was a 32/64 bit problem, I checked the registry to determine where my Oracle variables were: HKLM/Software/Oracle, or HKLM/Software/WOW6432/Oracle. I also tried running SQLPLUS from the command line, and checking weather the process displayed as *32 (to indicate a 32 bit application), in the Process Manager.

I think that's about it. Clearly there's no 'one size fits all, solution to this problem, but hopefully anyone who comes across this question will find some assistance in the details I've provided, and the helpful comments below.

Liam M
  • 5,028
  • 2
  • 37
  • 52
  • Does your IIS user have the correct permissions to execute the Oracle client – System Down Dec 17 '13 at 23:30
  • @SystemDown Hold on, let me try something. – Liam M Dec 17 '13 at 23:35
  • Memory is hazy (haven't worked with Oracle for quite some years), but you need to find the folder where the Oracle client exists and check the user permissions there. Your IIS user (depends on your OS) needs to have permissions. – System Down Dec 17 '13 at 23:37
  • Although System.Data.OracleClient is deprecated, I highly recommend that over Oracle.DataAccess if this is a small non-critical application. It is much easier to get up and running. I speak from experience and with the intention if saving you much frustration. I'm disappointed Microsoft deprecated it. Try it out and you'll see what I mean. ODP.NET is no bueno to set up. – mason Dec 17 '13 at 23:45
  • Thanks Guys, I'm investigating permissions, but that doesn't seem to be the problem. I'm running the application using my own account (full admin rights), and I'm still having the same problem. I've discovered my server is 32 bit whereas my workstation is 64 bit: I need to determine weather I've got a 64 bit Oracle client or a 32 bit Oracle client. – Liam M Dec 17 '13 at 23:59
  • Also, check your ORACLE_HOME variable and ensure it's pointing to the correct path. The specific error you're getting appears to be a 64bit/32bit compatibility issue. https://forums.oracle.com/thread/615607 – mason Dec 18 '13 at 00:16
  • I had same issue. I was running on IIS. I've tried to run using F5 IIS Express and it worked. So definitely it was IIS permissions. – Aurimas Neverauskas Dec 17 '14 at 14:59
  • Restarting PC solved problem. – Aurimas Neverauskas Dec 17 '14 at 16:04

1 Answers1

5

While you did not get a specific error message, there's a good chance that there is an incompatibility with ODP.Net (version numbers, 32bit vs 64bit DLLs) installed locally vs. on your test server.

This answer has several options which might help.

Community
  • 1
  • 1
Dillie-O
  • 28,071
  • 14
  • 93
  • 139
  • 1
    I think you could be onto something. I had another application which used the Oracle client. I tried running on the server and it crashed. So, I installed the Oracle client and ran it once more, and it worked. So, I'm going to use that as my litmus test, and try and determine the difference. – Liam M Dec 18 '13 at 00:29
  • 3
    I can't thank you enough - this was the answer, fundamentally. My project appears to be a bit broken, but you led me to the answer. Thanks! – Liam M Dec 18 '13 at 00:54