'ORACLE_HOME Environment Variable vs Registry

This is more of a question to help sharpen my understanding of behind the scenes Oracle magic than anything else.

I have been having some TNS issues lately when trying to serve a .NET REST API that uses EF with an Oracle .Net Provider. When I hit an endpoint, I received the exception 'ORA-12154: TNS:could not resolve the connect identifier specified'. After fiddling with VS Oracle provider settings, registry values, and environment variables (and several reinstalls), I found that adding ORACLE_HOME as a value to environment variables made this error go away.

My question is, if I have the same exact ORACLE_HOME value in the Oracle key in my registry, why does it throw an error if I remove the environment variable? Does this mean there is something screwy with my registry setup? I do not recall needing to have ORACLE_HOME environment variable in the past.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source