Ugly PS/C#/Oracle question that has me stumped

I’m stuck.
But I have an ugly complex problem that is unusual and driven by a rare situation.

I inherited code that I need to modify.
The PS script instantiates a C#.net object to connect to an Oracle database using Kerberos. The PS script does not connect directly to the DB, only through C#.

I can compile and run the C# code with no issues. It connects to Oracle with Kerberos without issues. The PS script can instantiate the C# object and call methods with no issues.
It’s all good. Except when PS calls a C# method to actually connects to Oracle. Then I get this error:
“default realm not found. Please set SQLNET.Kerberos.conf.”
The value is set in C# in the app.config. The value is set in the PS directory in the .exe.config file.
I suspect the PS script is not loading the config file even though the file is in the local script directory.
How can I resolve this? Is there some magic way to verify that the config is being loaded correctly?
thanks for any help

it’s going to be pretty hard to answer any questions about your code without seeing your code. If you don’t want to post the whole thing for security/privacy reasons, consider giving us a sanitized version.

1 Like