OracleInternal.MTS.DTCPSPEManager Error

3.6k views Asked by At

I'm getting this error only when TransactionScope is use within the code. Without TransactionScope its working fine for me.

This is ASP.NET application with Oracle database connecting using entity framework. Details as below.

<configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

<connectionStrings>
    <add name="MyEntities" connectionString="metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=(DESCRIPTION=(ADDRESS = (PROTOCOL
= TCP)(HOST = <>)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = <>)));PASSWORD=<>;PERSIST SECURITY INFO=True;USER ID=<>&quot;" providerName="System.Data.EntityClient" /> </connectionStrings>

Exception = The type initializer for 'OracleInternal.MTS.DTCPSPEManager' threw an exception.

InnerException = {"Could not load file or assembly 'Oracle.ManagedDataAccessDTC, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.":"Oracle.ManagedDataAccessDTC, Version=4.121.2.0, Cul...

Stack Trace at OracleInternal.MTS.DTCPSPEManager..ctor(OracleConnectionImpl connImpl, Transaction txn, MTSTxnRM txnRM, MTSTxnBranch txnBranch) at OracleInternal.MTS.PSPEManager.Create(OracleConnectionImpl connImpl, Transaction txn, MTSTxnRM txnRM, MTSTxnBranch txnBranch) at OracleInternal.MTS.MTSRMManager.EnlistTransaction(OracleConnectionImpl connImpl, Transaction transaction, MTSTxnRM txnRM, MTSTxnBranch txnBranch) at OracleInternal.MTS.MTSRMManager.EnlistTransaction(OracleConnectionImpl connImpl, Transaction transaction) at OracleInternal.ConnectionPool.PoolManager3.GetEnlisted(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp) at OracleInternal.ConnectionPool.OracleConnectionDispenser3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword) at Oracle.ManagedDataAccess.Client.OracleConnection.Open()

Please help me to resolve this issue. Thanks in advance.

2

There are 2 answers

1
Cham On

I copied Oracle.ManagedDataAccessDTC.dll into bin folder and that will resolve this issue.

E:\app\client\<user>\product\12.1.0\client_1\odp.net\managed\x86\Oracle.ManagedDataAccessDTC.dll

Thanks.

0
Genusatplay On

In my case(without EF) update .net framework 4.5 to 4.5.2 resolve this issue. All works fine without additional dll.