.net entity framework with oracle 11g

前端 未结 1 460
故里飘歌
故里飘歌 2021-01-01 06:08

i\'m using entity framework with the oracle provider (Oracle.ManagedDataAccessDTC)

Everything is working fine running that from visual studio, but when I publish tha

相关标签:
1条回答
  • 2021-01-01 06:46

    It looks like the managed driver is unable to resolve TNS names. You should make sure your configuration is correct (see Documentation).

    For example:

    <oracle.manageddataaccess.client>
      ...
      <settings>
        ...
        <setting name="TNS_ADMIN" value="C:\path\where\TNSNAMESFILE\is"/>
        ...
      </settings>
      ...
    </oracle.manageddataaccess.client>
    

    Also, you may need to configure the provider factory if not already defined in machine.config:

    <system.data>
      <DbProviderFactories>
    
        <remove invariant="Oracle.ManagedDataAccess.Client" />
        <add name="ODP.NET, Managed Driver"
          invariant="Oracle.ManagedDataAccess.Client"
          description="Oracle Data Provider for .NET, Managed Driver"
          type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
      </DbProviderFactories>
    </system.data>
    

    As an aside, I noted you are mentioning Oracle.ManagedDataAccessDTC as the managed driver. Please note that Oracle.ManagedDataAccessDTC is actually the component that provides support for distributed transactions, while the main driver assembly is called "Oracle.ManagedDataAccess".

    0 讨论(0)
提交回复
热议问题