Saturday 15 June 2013

asp.net mvc - ORA-12154: TNS:could not resolve the connect identifier specified (Oracle, ASP,Net, Dapper) -



asp.net mvc - ORA-12154: TNS:could not resolve the connect identifier specified (Oracle, ASP,Net, Dapper) -

i can't find exact issue have on here or anywhere.

i have asp.net mvc webapi (mvc 5.1.0, framework 4.5.1) project uses oracle.dataaccess. runs on local iis server via url that's in hosts file. has connection string connecting oracle database. works fine.

i have 'normal' asp.net mvc (mvc 5.2.2, framework 4.5.2) project uses oracle.manageddataaccess , dapper. runs on local iis server via url that's in hosts file. uses the same connection string (barring providername) (attempt to) connect oracle database. does not work, throwing

ora-12154: tns:could not resolve connect identifier specified

when seek open connection.

<add name="ourname" connectionstring="data source=xxxxx_migration2;persist security info=true;user id=ourusername;password=thepassword;enlist=false;min pool size=10;connection lifetime=120;connection timeout=30;incr pool size=5;decr pool size=2;" providername="oracle.manageddataaccess.client"/>

tnsnames.ora fine [as you'd reckon given exact same connection string works in other project], there no brackets in project file paths (a obscure issue found in researches), oracle_home pathed... stumped.

i know dapper extends connection object - have funky weird requirements might causing this?

edit: if switch 'normal' asp.net mvc (and connection string providername parameter) oracle.dataaccess, , don't utilize dapper can connect.

in end, needed create more config file changes thought, in order create oracle.manageddataaccess work (dapper not issue).

see this blog article

and accepted reply here

it's little bit annoying, , alter past situation have manually specify location of tnsnames.ora in config file - hey, it's config file after all.

asp.net-mvc oracle dapper

No comments:

Post a Comment