This discussion is archived
2 Replies Latest reply: May 1, 2013 6:14 AM by 977995 RSS

Register a DLL? or some other problem?

977995 Newbie
Currently Being Moderated
I have an app written in C# that I have copied out to several 32 bit machines. It works fine. We just started rolling out some 64 bit machines. I installed sql developer on that machine and we struggled a bit, but finally got it working fine. Then, I installed my app. When it runs, and tries to connect to Oracle, the error is "Type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.

I am wondering if I need to register a dll? If so, I don't know which one? We have tried updating everything we could find. All machines have .NET 4.5 running. I think I need to hook Oracle to Windows?

Any thoughts would be appreciated.

Thanks,
Dave
  • 1. Re: Register a DLL? or some other problem?
    Tridus Journeyer
    Currently Being Moderated
    It'd be helpful to know what the exception being thrown is (would be the InnerException of the one you're catching), but it's most likely a problem with the bit-ness of the application. If the compiler is set to AnyCPU (and it is by default), on the 64 bit machine you'll need a 64 bit version of the Oracle client. If you set it to x86, then you'll need a 32 bit Oracle client on all the machines (including the 64 bit ones).

    Just registering a DLL won't be enough to solve this unless you're using the managed client beta, in which case you could do that or add the necessary entries into the app config file (and not have to register anything).
  • 2. Re: Register a DLL? or some other problem?
    977995 Newbie
    Currently Being Moderated
    Thanks! That was indeed the problem. I will have to work out details moving forward. For now, I installed the 32 bit Oracle client on the 64 bit machine and everything started working.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points