无法加载文件或程序集“Oracle.ManagedDataAccessDTC.DLL”或其依赖项之一
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25928970/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not load file or assembly 'Oracle.ManagedDataAccessDTC.DLL' or one of its dependencies
提问by Waleed Baig
we have an ASP.Net 4.5.2 application using the latest Oracle.ManagedDataAccess.dll from nuget with Entity Framework 5.
我们有一个 ASP.Net 4.5.2 应用程序,它使用来自 nuget 的最新 Oracle.ManagedDataAccess.dll 和 Entity Framework 5。
File version: 4.121.1.0
文件版本:4.121.1.0
Product version: 4.121.1.20131211
产品版本:4.121.1.20131211
When deployed to production environment (Windows Server 2008 r2 x64) all works fine, until we need distributed transactions.
当部署到生产环境(Windows Server 2008 r2 x64)时,一切正常,直到我们需要分布式事务。
Oracle documentation states that we need to provide Oracle.ManagedDataAccessDTC.dll (of same version, for specific platform x64) in order to get distributed transactions working.
Oracle 文档指出,我们需要提供 Oracle.ManagedDataAccessDTC.dll(相同版本,适用于特定平台 x64)以使分布式事务正常工作。
Could not load file or assembly 'Oracle.ManagedDataAccessDTC.DLL' or one of its dependencies. The specified module could not be found.
无法加载文件或程序集“Oracle.ManagedDataAccessDTC.DLL”或其依赖项之一。指定的模块无法找到。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.ManagedDataAccessDTC.DLL' or one of its dependencies. The specified module could not be found.
异常详细信息:System.IO.FileNotFoundException:无法加载文件或程序集“Oracle.ManagedDataAccessDTC.DLL”或其依赖项之一。指定的模块无法找到。
Stack Trace:
堆栈跟踪:
[FileNotFoundException: Could not load file or assembly 'Oracle.ManagedDataAccessDTC, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. ]
[FileNotFoundException:无法加载文件或程序集“Oracle.ManagedDataAccessDTC,版本=4.121.1.0,Culture=neutral,PublicKeyToken=89b483f429c47342”或其依赖项之一。]
回答by Jener Garcia Menezes
Install the Microsoft Visual C++ 2010 Redistributable.
安装 Microsoft Visual C++ 2010 Redistributable。
If your server is a Windows Server 2008 R2 x64, install from this page: http://www.microsoft.com/en-us/download/details.aspx?id=14632the with SP1 don't work for this server.
如果您的服务器是 Windows Server 2008 R2 x64,请从此页面安装:http: //www.microsoft.com/en-us/download/details.aspx?id=14632 SP1 不适用于此服务器。
If your server is a Windows Server 2012 x64, install from this page: http://www.microsoft.com/en-us/download/details.aspx?id=13523
如果您的服务器是 Windows Server 2012 x64,请从此页面安装:http: //www.microsoft.com/en-us/download/details.aspx?id=13523
回答by imekon
My solution turned out to be stop using TransactionScope, and remove a reference to System.Transactions, then the issue went away.
我的解决方案原来是停止使用 TransactionScope,并删除对 System.Transactions 的引用,然后问题就消失了。
I could get away with this TransactionScope didn't give me any further performance improvements.
我可以摆脱这个 TransactionScope 没有给我任何进一步的性能改进。
回答by steven2308
I had this problem for several months where our product would have problems in some computers (say 1 out of every 10) when the application used transactions.
几个月来我遇到了这个问题,当应用程序使用事务时,我们的产品在某些计算机上会出现问题(比如每 10 台计算机中的 1 台)。
I tried John's answer and the problem stopped but later I noticed that the transactions where not working at all anymore, in any of the installations.
我尝试了约翰的回答,问题停止了,但后来我注意到在任何安装中,事务都不再起作用了。
Finally I got to this, where you can see that the Oracle.ManagedDataAccessDTCwon't be used in .NET Framework Version 4.5.2 or higher. We were using 4.5, so I upgraded the framework to 4.5.2 in two of the computers with that problem and now they work perfectly.
最后我到了这里,您可以看到Oracle.ManagedDataAccessDTC不会在 .NET Framework 4.5.2 或更高版本中使用。我们使用的是 4.5,因此我将其中两台存在该问题的计算机的框架升级到 4.5.2,现在它们可以完美运行。
So to sum up, upgrading the .Net version to 4.5.2 or higher should solve the problem.
所以综上所述,将.Net版本升级到4.5.2以上应该可以解决问题。