OCI mode without install or instant client

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
markolsz
Posts: 2
Joined: Fri 07 Jan 2022 16:40

OCI mode without install or instant client

Post by markolsz » Fri 07 Jan 2022 17:02

I am trying to setup my application so that ALL of the dependencies needed for my application are present in the bin directory, so no installation or configuration is needed on the server prior to application deployment.

I do not want to install oracle software
I do not want to copy instant client and modify PATH environment variable

All of the OCI dlls are included in my bin directory.
All Devart dlls are included in my bin directory

Is there a way, from config files in my application (or other means), to tell devart to find the necessary Oracle dlls in my bin directory?

I know the dlls present in my bin dir work because when i change PATH environment variable to point to bin directory, my application functions just fine. But i do not want to have to modify the PATH environment variable.

Thanks in advance!

DmitryGm
Devart Team
Posts: 152
Joined: Fri 11 Dec 2020 10:27

Re: OCI mode without install or instant client

Post by DmitryGm » Mon 10 Jan 2022 19:36

In the Windows system, the current path is a path by default. So instead of specifying the path to the Oracle Instant Client in the PATH system variable, you can just copy all the Oracle Instant Client files and directories to the bin directory (not to a subfolder, but to the same level with the app).

But perhaps the easiest way for you is using Direct Mode.

markolsz
Posts: 2
Joined: Fri 07 Jan 2022 16:40

Re: OCI mode without install or instant client

Post by markolsz » Fri 21 Jan 2022 20:47

Placing the oracle dlls in the bin directory did not work for me.

The application i am running is a .net framework web application hosted in IIS.
I tried both placing the dlls in the bin directory itself and the application root (1 level higher than bin folder)

Note: I was able to confirm that for a console application, placing the oracle dlls in the application root folder did work

Is there a reason why the same technique does not work with my IIS hosted site/services?

Keep in mind that the goal here is to deploy everything needed by the application within the application itself, so i would not have access to the location where IIS process executable is actually running, only my application folder and contents.

Thanks

DmitryGm
Devart Team
Posts: 152
Joined: Fri 11 Dec 2020 10:27

Re: OCI mode without install or instant client

Post by DmitryGm » Mon 24 Jan 2022 17:13

I suppose the Oracle Client should be situated in the current directory of the server process, and it may differ from the bin folder.

Since you cannot change the value of system environment variables, you can try doing the following in your code before the opening Oracle connection:

Code: Select all

System.Environment.SetEnvironmentVariable("PATH",
                @"D:\PATH_TO_ORACLE_CLIENT;" + System.Environment.GetEnvironmentVariable("PATH"));
Also, why don't you just use Direct Mode? For such a case, it is intended.

Post Reply