0

My application needs an Oracle .dll which I deploy into the bin folder of the application along with the rest, and it works fine.

But what I want to do is to avoid deploying the library, so I need the server to know where to look for it. I added the .dll into C:\Oracle\bin, a path which is included at Path system variable. But it can't find the assembly if it's not into the application's bin folder.

Any hints, please?

Armaggedon
  • 399
  • 4
  • 14
  • Have a look at how [Fusion resolves things](http://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.110).aspx) – StuartLC Feb 28 '14 at 10:47
  • If you load you load your assemblies on runtime, you can set dll search path like this http://stackoverflow.com/questions/1373100/how-to-add-folder-to-assembly-search-path-at-runtime-in-net – Redwan Feb 28 '14 at 10:49

2 Answers2

0

This is pretty much have things work. You have discovered 2 viable deployment options. 1) Bundle it in your applications bin directory or 2) Install the oracle network protocol correctly and using the install API.

There are really only 2 more options that I can think of. 1) Statically link with the necessary network libraries -- I don't recall ever seeing these available on Windows, I know I have used static linking to OCI libraries on Unix, been a long time ago though. 2) Host the Oracle connectivity in a middle tier and have you deployed application always make calls to your middle tier (instead of direct Oracle calls)

BTW, you probably do not want to use the OCI libraries, ugly code compared to the modern ways of doing it.

Gary Walker
  • 8,831
  • 3
  • 19
  • 41
-1

If you go into the reference properties for the dll that you are trying to add you can change the Copy Local property to False. This will allow for the program to pull the dll from the original location that you found the dll in.

The only thing that you have to watch out for is that your dll is in the same location on your dev PC as it is on your Server if it isn't your program will not find your dll. an example of this is if the dll on your server is in C:\Oracle\bin it must be at C:\Oracle\bin on your dev PC.

Trax5
  • 3
  • 2