Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

My managed ODP.net webapp works locally but when deploying it to a server, it fails with the error:

"TNS:listener does not currently know of service requested in connect descriptor"

From looking around, it seems like this is because it can't get to the tnsnames.ora file.

I have tried the following with no success:

  • Placing a tnsnames.ora file (the same one that works locally) into an [oracle home][product]... etworkadmin folder.
  • Setting a TNS_ADMIN setting in the Managed ODP's web.config section pointing to the environment variable.
  • Setting the TNS_ADMIN setting in the Managed ODP's web.config section pointing directly to the tnsnames.ora file.

On the server, attempting to run tnsping yields error TNS-03502: Message 3502 not found; No message file for product=NETWORK, facility=TNS

What am I missing?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
824 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try using a connection string that doesn't depend on tnsnames.ora, such as:

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...