Question

After spending several days reading threads here and troubleshooting numerous messages regarding ODP.Net errors between my development machine and production, I want to run my take aways by the experts here to make sure a) I am correct in my assumptions, and b) there isn't a better way of solving this in the future.

My basic take away is that I should always start by looking in the GAC of my ultimate destination server to identify the version of the Oracle.DataAccessClient.dll. Then I should make sure that the version of the DLL I add as a reference in VS matches what is on the final destination machine. I'm not totally sure why I need to match what is in the GAC since I'm copying the dll to the bin directory anyway, but that's not really my question.

So what happens when your development, staging/testing and production environments don't have exactly the save version of the DLL? Based on some threads Deploying and Configuring ODP, it seems like I might be able to just copy the instant client files directly into my applications bin directory and not worry about what is already on any of the machines. Is that correct?

Any other thoughts or suggestions? Thank you.

Was it helpful?

Solution

Solved finally - The solution was to use the Oracle Managed Driver instead of the Unmanaged driver. This link was very helpful in explaining benefits along with the referenced video showing step by step how to make the change from unmanaged to managed. Oracle ODP.net Managed vs Unmanaged Driver

I also had to use a tnsnames-less configuration (copying tnsnames.ora didn't work for me as described in the video). I.e. I used Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521‌​)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));User Id=oracle_user;Password=oracle_pwd;" as part of my connection string. I've tested on three different systems so far and all seem to workgreat. To make it easier to manage I just pull my parameters from my app/web.config file and populate the above string.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top