具有Oracle数据库连接的.Net Core 2.0

时间:2019-02-15 16:31:57

标签: asp.net-core

使用当前的.Ora文件,我们能够在.net 2.0和3.5中进行连接,而无法与.net core 2.0连接,无论与旧文件相比,是否需要修改.ora文件。请告诉步骤

OracleInternal.Network.NetworkException(0x00002F7A): ORA-12154:TNS:无法解析指定的连接标识符    在OracleInternal.Network.AddressResolution..ctor(String TNSAlias,String instanceName)    在OracleInternal.Network.OracleCommunication.DoConnect(字符串tnsDescriptor)    在OracleInternal.ServiceObjects.OracleConnectionImpl.Connect(ConnectionString cs,布尔值bOpenEndUserSession,OracleConnection connRefForCriteria,字符串instanceName)    在OracleInternal.ConnectionPool.PoolManager 3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OracleConnectionDispenser中的3.Get(ConnectionString cs,PM conPM,ConnectionString pmCS,SecureString securePassword,SecureString secureProxyPassword,OracleConnection connRefForCriteria)    在Oracle.ManagedDataAccess.Client.OracleConnection.Open()    在D:\ Samples \ TodoApi \ TodoApi \ Startup.cs:line 68}中的TodoApi.Startup.b__5_0(HttpContext上下文)中

1 个答案:

答案 0 :(得分:0)

在应用程序客户端文件夹内的tns .ora文件中输入正确的配置,或在json文件中检查您的连接字符串。