ASP.NET bin 目录中的 Oracle oci.dll 无法删除/不起作用

发布于 2024-08-19 10:26:16 字数 1706 浏览 2 评论 0原文

我按照此处的说明进行操作: http://splinter.com.au/blog/?p= 156 尝试在不安装 Oracle 11g 客户端的情况下使用较新版本的 ODP.NET。到目前为止,除了重新启动 IIS 之外,我遵循了所有步骤。

然而,这引起了一些问题,我真的很好奇为什么。如果我尝试使用 ODP.NET,当 Oracle 连接尝试连接(例如 ConnectExample.Open())时,我会遇到抛出空白异常。

但最奇怪的是:我无法删除 oci.dll。据说正在使用中。什么可以使用这个dll?当本机 dll 位于 Bin 目录中时,ASP.NET 到底对它做什么?我认为这可能涉及 oci.dll,但是如果我在桌面 WinForm 应用程序中以类似的方式使用该 dll,那么 oci.dll 就不会被锁定,我可以自由删除它。

另外,在我尝试使用它后,正常的 System.Data.OracleClient 停止工作。它现在抛出一个异常,OCIEnvCreate 返回 -1。

我将尝试重新启动 IIS,希望这能解决此问题,但我想知道这里发生了什么(以及是否可以在不重新启动 IIS 的情况下解决该问题)。有人有想法吗?

编辑:我尝试重新启动 IIS,但没有解决任何问题

编辑 #2:我认为我没有很好地阐述这个问题,但这是因为我假设重新启动 IIS 会起作用。现在我只需要知道为什么它不起作用。在谷歌搜索类似问题时,我只遇到了 2 个论坛帖子,它们讲述了我的确切问题:Oracle ODP.NET 在尝试连接时返回空白异常。以下是这些链接的链接:

http://kr.forums.oracle。 com/forums/thread.jspa?threadID=632296

http:// /forums.oracle.com/forums/thread.jspa?threadID=549864

上面的韩文链接是最有趣的。他们进行了完整安装,这让我怀疑我的问题不在于文件或丢失的文件。我想知道“如果在建立 ODP DLL 之前调用 OCI DLL,生产服务器将抛出空白异常”是什么意思?

编辑/更新#3:我们部门有一个内联网服务器,我今天可以对其进行测试。我将所需的 dll 添加到 Bin 文件夹中,一切正常,无需重新启动 IIS。我不问。我将在此服务器上尝试更多测试,看看是否可以复制问题

编辑#4(奥德赛继续):我确定 ASP.NET(或ODP.NET 库)甚至找到 11g 客户端 dll,之后 oraocci11.dll 似乎永远不会再使用并且可以删除。不确定这对我的问题意味着什么,但由于它增加了这里的知识库,我想我应该提到它

编辑#5:我添加了 mfc71.dll 和 msvcr71.dll,2 个处理 C/MFC 的 Windows 系统文件,以Bin 目录,因为我发现 ODP.NET 需要它们(或者至少是客户端需要)。这至少使事情停留在旧的熟悉的“客户端不兼容”错误上。我删除了这 2 个 DLL,果然它又回到了上面给出的相同错误。然而,将它们添加回来并没有使这些错误消失,所以我必须再次重置 IIS。

I followed the directions here: http://splinter.com.au/blog/?p=156 in an attempt to use a newer version of ODP.NET without installing the Oracle 11g client. I followed everything, so far, except for restarting IIS.

However, this has caused some problems and I'm really curious as to why. If I try to use ODP.NET I'm met with a blank exception thrown when the Oracle connection tries to connect (ConnectExample.Open() for instance).

But most curiously: I can't delete oci.dll. It says it's in use. What could be using this dll? What exactly does ASP.NET do with a native dll when it's within the Bin directory? I thought that maybe this is something involving the oci.dll, but if I use the dll in a similar fashion in a desktop WinForm application then the oci.dll doesn't get locked, and I can delete it freely.

Also, after I tried using it the normal System.Data.OracleClient stopped working. It now throws an exception that OCIEnvCreate returns with a -1.

I will try restarting IIS, and hopefully that will fix this, but I'd like to know what's going on here (and if it can be solved without restarting IIS). Does anyone have an idea?

Edit: I tried restarting IIS and that didn't fix a thing

Edit #2: I don't think I formulated this question very well, but that was due to my assuming restarting IIS would work. Now I just need to know why it isn't working. In Googling for similar problems I've only encountered 2 forum posts which told of my exact problem: Oracle ODP.NET returning a blank exception when trying to connect. Here's the links to those:

http://kr.forums.oracle.com/forums/thread.jspa?threadID=632296

http://forums.oracle.com/forums/thread.jspa?threadID=549864

The Korean link above is the most interesting. They have a full install which leads me to suspect my problem isn't with the files or missing files. I wonder what they mean by "production servers throwing blank exceptions if a call to the OCI DLL is made before the ODP one can be established"?

Edit/Update #3: We have an intranet server here for our department that I was able to test on today. I added the required dll's to the Bin folder and everything worked without the need to restart IIS. I don't ask. I'll try some more testing on this server to see if I can replicate the problem

Edit #4 (the odyssey continues): I determined that oraocci11.dll (the C++ call interface DLL) is needed initially by ASP.NET (or the ODP.NET library) to even find the 11g client dll's, after that oraocci11.dll seems to never be used again and can be deleted. Not sure what that means for my problem, but since it adds to the knowledge base here I figured I'd mention it

Edit #5: I added mfc71.dll and msvcr71.dll, 2 Windows systems files dealing with C/MFC, to the Bin directory as I discovered they're needed by ODP.NET (or at least, needed by the client). This, at the very least, made things stay on the old familiar "Client not compatible" error. I removed those 2 DLLs and sure enough it went back to the same errors given above. Adding them back didn't make those errors go away, however, so I'll have to reset IIS again.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

今天小雨转甜 2024-08-26 10:26:16

使用 services.msc 停止万维网发布服务,然后进行更改,而不是(或同时)停止 IIS。

我们发现,对于 ASP.NET 应用程序使用的图形控制 DLL,仅停止 IIS 是不够的,因为您无法删除该文件(或粘贴等)。但是一旦万维网发布服务停止,它就可以被删除或覆盖......

Instead of (or as well as) stopping IIS, stop the World Wide Web Publishing Service using services.msc and then make your changes.

We found that for a graph control DLL being used by an asp.net application, just stopping IIS wasn't enough as you were not able to delete the file (or paste etc). But once the World Wide Web Publishing Service was stopped, it could then be deleted or overwritten...

琉璃梦幻 2024-08-26 10:26:16

典型的 Oracle 体验。

我也有同样的问题。解锁器不起作用。我尝试了几次 - 所有报告都报告文件根本没有被锁定,但随后又报告他们无法删除它。

停止 IIS 和大多数非核心 Windows 服务不起作用。

解决方案是重命名该文件,重新启动,然后将其删除。由于某种原因,Windows 允许您重命名锁定的文件并使其保持锁定状态,但重新启动后,尝试锁定“oci.dll”会失败,因为它不再以该名称存在。

A typical Oracle experience.

I had this same problem. Unlockers do not work. I tried several -- all report that the file isn't locked at all, but then report that they cannot delete it.

Stopping IIS and most non-core Windows services doesn't work.

The solution is to rename the file, reboot, then delete it. For some reason, Windows allows you to rename a locked file and keeps it locked, but upon rebooting the attempt to lock "oci.dll" fails because it no longer exists under that name.

梅窗月明清似水 2024-08-26 10:26:16

至于 DLL,您必须停止 IIS,删除它们,然后启动 IIS。这是因为它们是本机 DLL,而不是 C# DLL。 C# 的“卷影复制”功能不适用于本机 dll,这就是它们被锁定的原因。

至于甲骨文,我已经通过电子邮件给您发送了一些尝试的东西...实际上,当您找到解决方案时,我们应该更新此页面。

As for the DLL's, you'll have to stop IIS, delete them, then start IIS. This is because they are native DLL's, not C# dll's. C#'s 'shadow copy' feature doesn't apply to native dll's, which is why they are locked.

As for oracle, i've emailed you some stuff to try... really we should update this SO page when you find a solution.

陈甜 2024-08-26 10:26:16

如果 IIS 不是锁定文件的进程,并且您确实陷入困境,Unlocker 可以帮助查看实际锁定文件的内容,以及释放这些锁定并强制删除文件。

此处获取

Should it be that IIS is not the process locking the file, and you are really stuck, Unlocker can help with seeing what is actually locking the file, as well as releasing those locks and deleting the file forcefully.

Get it here

暮凉 2024-08-26 10:26:16

据我所知,有 3 件事可以让您删除该文件以及属于 Oracle 数据访问客户端的其他文件:

1.) 停止 IIS 中的应用程序池。

2.) 关闭 Visual Studio。

3.) 重新启动机器。

There are 3 things I know of that will allow you to delete this and other files that are part of the Oracle Data Access Client:

1.) Stop the application pools within IIS.

2.) Close Visual Studio.

3.) Reboot the machine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文