Can xpp deploy be used to deploy ODP 11 and not modify PATH?

I have an application using Oracle.DataAccess to connect. I've already found that coverage size can be reduced using ODAC 11 with xcopy deployment. This is already a great victory.

Ideally, however, we won't need to change any path variables and have all the ODAC files in a subdirectory under the application folder. Can I do this without changing the PATH variable? Is there a way to set a temporary PATH variable? Can we copy all the files needed for the application folder?

The general idea is that we want to isolate our ODAC files as much as possible from other applications that might be running on the same client.

+1


source to share


5 answers


System.Environment.SetEnvironmentVariable allows you to change the environment block of a process. However, whether what is known for the PITA Oracle is enough, everyone can guess.;)



+4


source


Like Mark , you can always change your value for the environment variable for the current process. Note that you obviously have to do this before the ODP.NET call is made.

Also note that if you only want pure ODP.NET functions, by which I mean, which you don't specifically need:



If that's the case, you can distribute the Oracle Instant Client with your application. See this question for details .

+3


source


Changing the environment variable is a sweet hack, but for the sake of academic completeness, I believe inlining an assembly solution is actually the "right" way to solve this problem, even if it's more code.

+2


source


0


source


As mentioned earlier, this StackOverflow question talks about how you can achieve your goal. This answer is not bad. I commented on this answer that I was able to use the Easy Connect connection string and use the same binary on my production machine and my development machine by simply copying the Instant Client Lite and Oracle.DataAccess.dll dlls to the application folder on the production machine. On my development machine, I have the full Oracle client installed. Thus, there is no need to change the path instructions at all.

0


source







All Articles