c# - Open Oracle connection failed while using Oracle.ManagedDataAccess -
i'm testing oracle.manageddataaccess 4.121.1.0 .net console application , powershell script, fine in c# application. unfortunately have strange issue powershel script while try open oracle connection open method.
here powershell "script"
add-type -path 'c:\oracle\odp.net\managed\common\oracle.manageddataaccess.dll' $cnx = 'data source=(description=(address_list=(address=(community = tcp.world)(protocol = tcp)(host = host)(port = 1521)))(connect_data=(sid=sid)));user id=user;password=pwd;' $con = new-object oracle.manageddataaccess.client.oracleconnection("$cnx") $con.open()
the error thrown
exception lors de l'appel de « open » avec « 0 » argument(s) : « impossible de trouver l'asse mbly 'oracle.manageddataaccess, version=4.121.1.0, culture=neutral, publickeytoken=89b483f429 c47342'. » au niveau de c:\oracle\oracle.ps1 : 5 caractère : 10
the same code written in c# console application works fine.
i think configuration issue, i'm lost ...
anyone have issue ?
thx
the new oracle managed data access assembly supports .net 4.0 , above. if you're using powershell 2.0 you're on .net 3.5 or .net 2.0
you'll need use powershell v3 or try setting powershell v2 use higher version of .net described in blog post. note: break things remoting:
http://tfl09.blogspot.com/2010/08/using-newer-versions-of-net-with.html
alternatively suggested "semi-managed" 11g client.
Comments
Post a Comment