c# - Entity Framework 4 + Oracle: Working in local pc but not on Windows Server 2008 R2 -
i'm trying create sample project ef4 oracle database.
in pc created project.
some of characteristics (if more info needed please so)
- visual studio 2010
- entity framework 4.1 db first + dbcontext
- platform target "any cpu"
- oracle bd 11g
- my db connection created using "server explorer" -> "data connections" -> "oracle data provider .net"
- i have 1 oracle home 11.2 both client_32 , client_64 folders
- i make no reference oracle.dataaccess.client in project
- in gac find oracle.dataaccess vs 2.112.3.0 x86, 2.112.1.0 x86, 2.112.4.0 amd64, 2.112.3.0 amd64, 2.112.1.0 amd 64
- listing pc providers
- odbc data provider version=4.0.0.0
- oledb data provider version=4.0.0.0
- oracleclient data provider version=4.0.0.0
- sqlclient data provider version=4.0.0.0
- oracle data provider .net version=4.112.4.0
- microsoft sql server compact data provider version=3.5.1.0
- microsoft sql server compact data provider 4.0 version=4.0.0.0
running project (that makes simple add using 1 of entities generated ef) in pc, works fine.
the server:
- windows server 2008 r2 standard
- 1 oracle home in app64/32, vs 11.2
- all iis apppools can run 32bit
- in gac have oracle.dataaccess 2.112.1.0 x86 , amd64
- listing providers can see
- odbc data provider version=4.0.0.0
- oledb data provider version=4.0.0.0
- oracleclient data provider version=4.0.0.0
- sqlclient data provider version=4.0.0.0
when running program on server following error: "[argumentexception: unable find requested .net framework data provider. may not installed.] system.data.common.dbproviderfactories.getfactory(string providerinvariantname)"
looking @ providers realized provider "oracle data provider .net" missing in server, tried multiple oracle installations (odac, odp, xcopy) nothing seems work, althouth several files installed (i used existing oracle home), provider keeps not showing, in registry, under software\oracle\odp.net keep seeing 2.112.1.0 version.
after tried deploy exe oracle dlls , change app.config include
<system.data> <dbproviderfactories> <remove invariant="oracle.dataaccess.client" /> <add name="oracle data provider .net" invariant="oracle.dataaccess.client" description="oracle data provider .net" type="oracle.dataaccess.client.oracleclientfactory, oracle.dataaccess, version=4.112.3.0, culture=neutral, publickeytoken=89b483f429c47342"/> </dbproviderfactories>
but following error: system.data.entityexception: underlying provider failed on open -> oracle.dataaccess.client.oracleexception: ora-12557: tns:protocol adapter not loadable.
searched error , somewhere found should try ezconnect form (user/pass@host:port/sid) configuration exception...
as of right now, other aplications running using oracle (i can't see how these running) stopped working, i'll have go befora installations...
i've been in 3 days , don't know do. after server has been restores know else can try?
========================= update 1 ================================
after server got restored before noticed forgot check
in regedit have:
- hkey_local_macine/software/oracle/key_oraclient11g_home1/oracle_home -> d:\app64\product\11.2.0
obviously have oracle stuff 64bit, next move change program 64bit. resulted in same error, after figured needed instal 64bit odac. downloaded odac112021xcopy_x64 , installed it. oracle data provider .net version appears (but version 4.112.2.0). running app gives following error :
system.data. provider incompatible exception: store provider factory type 'oracle.dataaccess.client.oracleclientfactory' not implement iserviceprovider interface
after searching error wen check gac64 bits. can see oracle.dataaccess.dll in c:\windows\microsoft.net\assembly\gac_64\oracle.dataaccess\v4.0_4.112.2.0__89b483f429c47342.
what should next step? unistall odac , try newer version of 11? reading (http://netdevelopmentmanfreddahmen.blogspot.pt/2013/07/c-error-store-provider-factory-type.html) seems need, ef, version 112.3.0 or later , .net 4 or later
and guess what? tchanan!! worked :)
good news that, installing odac did not affected (as far see) remaining , running apps using oracle.
note: installed odac using command install.bat d:\app64\produc t\11.2.0 oracle - oraclient11g_home1
in resume:
.net + ef + oracle prerequisites
- .net 4 or above
- at least 1 oracle home installed
- odac 11.2.0.3.0 or above
- make sure bit signature of oracle , of software same
- in case using 32bit, sure apppools allow 32bit
note: ef version not seem matter
Comments
Post a Comment