Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bug: network path resolving for .NET Core drivers is broken

Yves_DJun 21 2019 — edited Oct 10 2019

Hello,

As I didn't find an official way to report a bug in the Oracle Data Provider for .NET Core, I will try through this forum.

We are using the TNS_ADMIN environment variable on our development systems and let it point to a share \\share\oracle . When trying to connect to a database, we are getting the famous "Unable to resolve ORA-12154: TNS:could not resolve the connect identifier specified". Turning on tracing, we discovered that the driver is looking for the tnsnames.ora in c:\share\oracle .

Decompiling the driver and checking the code learned us that at some point in the OracleInternal.Common.ConfigBaseClass.GetResolvedFileLocation the path stored in the TNS_ADMIN is split in its different parts based on the directory separator, thereby ignoring empty entries. Later on, in OracleInternal.Common.ConfigBaseClass.ResolveEnvVariables the entire thing is reassembled again, but of course incorrectly since information was lost during the path split.

So, in our case \\share\oracle became ['share', 'oracle'] which became 'share\oracle' and thus resolved to c:\share\oracle . And of course, that path didn't exist.

This post has been answered by Alex Keh-Oracle on Jun 25 2019
Jump to Answer

Comments

mNem

As a suggestion, please post the class file that requires minimal effort from someone who may want to look into your issue - i.e. a class file that compiles and can be copy pasted. Additionally post all dependencies required and the expected result.

morgalr

I think you would have a lot better luck, reading a line, and then doing the mods you choose, then writing the line out to the new file so:

read in

mod or not

write out

loop until done

rename the old file

rename the new file

close it all up

Simple... is always better if it works just as well.

1 - 2

Post Details

Added on Jun 21 2019
8 comments
3,933 views