.netentity framework与oracle 11g

我正在使用oracle提供程序的entity framework(Oracle.ManagedDataAccessDTC)

从visual studio可以正常运行一切,但是当我将它发布到IIS时,我收到一个连接错误exception。

这是我的webconfig女巫在visual studio上运行得很好:

         

这是我在IIS上遇到的错误:

 Server Error in '/EA' Application. ORA-12154: TNS:não foi possível resolver o identificador de conexão especificado Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: OracleInternal.Network.NetworkException: ORA-12154 could not resolve the connect identifier specified Source Error: Line 24: public List GetCadastroBy(string CPF, string Cartao) Line 25: { Line 26: return ent.CADASTRO.Where(x => x.CPF.Equals(CPF) && x.NUMEROSEUCARTAO.Equals(Cartao)).Select(x => x).ToList(); Line 27: } 

来自sql plus的查询工作正常。

任何想法的家伙?

解:

         

在webconfig上。

看起来托管驱动程序无法解析TNS名称。 您应确保配置正确(请参阅文档 )。

例如:

  ...  ...  ...  ...  

此外,如果尚未在machine.config定义,则可能需要配置提供程序工厂:

       

顺便说一句,我注意到你提到Oracle.ManagedDataAccessDTC作为托管驱动程序。 请注意,Oracle.ManagedDataAccessDTC实际上是为分布式事务提供支持的组件,而主驱动程序程序集则称为“Oracle.ManagedDataAccess”。