Search code examples
.netoracle-databasedllodacoracle-manageddataaccess

Lightswitch Application fails to find 'Oracle.ManagedDataAccessDTC' when deployed on IIS


I created a basic HTML Lightswitch application with no custom code in Visual Studio 2013. It connects to an Oracle database and runs fine locally.

I deployed the app to a server with IIS and the app loads when I navigate the url I created but I get the "The underlying provider failed on EnlistTransaction" error before the app would normally display a list of values from the Oracle database.

I ran a stacktrace to find the following error. It looks like the app is not finding the Oracle data access client(Oracle.ManagedDataAccessDTC):

[Microsoft.LightSwitch.DataService][Application:Error]
[LightSwitchServiceApplication.P167:CON_APP_TAXes] An exception has occurred:  
Microsoft.LightSwitch.DataServiceOperationException: The underlying provider 
failed on EnlistTransaction. ---> System.Data.EntityException: The underlying 
provider failed on EnlistTransaction. ---> 
System.TypeInitializationException: The type initializer for 
'OracleInternal.MTS.DTCPSPEManager' threw an exception. ---> 
System.IO.FileNotFoundException: 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.

I installed the Oracle Data Access client on my machine locally using the ODAC 12c Release 4(12.1.0.2) Installer which includes Oracle.ManagedDataAccessDTC.

I verified that my machine and the server have the same version of Oracle.ManagedDataAccessDTC installed.


Solution

  • This issue was resolved from switching my data source driver type from Oracle Database (ODP.NET, Managed Driver) to Oracle Database (ODP.NET, Unmanaged Driver).