部署在IIS上时,Lightswitch应用程序无法找到“Oracle.ManagedDataAccessDTC”

时间:2016-08-16 20:43:08

标签: .net oracle dll odac oracle-manageddataaccess

我在Visual Studio 2013中创建了一个没有自定义代码的基本HTML Lightswitch应用程序。它连接到Oracle数据库并在本地运行良好。

我将应用程序部署到带有IIS的服务器,当我导航我创建的网址时,应用程序会加载,但是在应用程序正常显示Oracle数据库中的值列表之前,我得到“基础提供程序在EnlistTransaction上失败”错误

我运行了一个堆栈跟踪来查找以下错误。看起来应用程序没有找到Oracle数据访问客户端(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.

我使用包含Oracle.ManagedDataAccessDTC的ODAC 12c Release 4(12.1.0.2)安装程序在本地计算机上安装了Oracle Data Access客户端。

我确认我的机器和服务器安装了相同版本的Oracle.ManagedDataAccessDTC。

1 个答案:

答案 0 :(得分:0)

通过将我的数据源驱动程序类型从Oracle数据库(ODP.NET,托管驱动程序)切换到Oracle数据库(ODP.NET,非托管驱动程序),解决了此问题。