windows Regsvr32 无法在当前文件夹中找到 dll

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1199558/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:53:36  来源:igfitidea点击:

Regsvr32 fails to find the dll in the current folder

windowscomregsvr32

提问by cfischer

When I use "regsvr32 foo.dll" i get a "The specified module cannot be found" error.

当我使用“regsvr32 foo.dll”时,出现“找不到指定的模块”错误。

The error is being caused because regsvr32 cannot find the file even though it is the current folder.

该错误是由于 regsvr32 无法找到该文件而导致的,即使它是当前文件夹。

I have specified the full path, and it still doen't work. Any ideas????

我已经指定了完整路径,它仍然不起作用。有任何想法吗????

回答by ars

This can happen if foo.dllhas a depenency on bar.dlland it's actually bar.dllthat can't be found.

如果foo.dll有依赖关系,bar.dll并且实际上bar.dll无法找到,则可能会发生这种情况。

Try using depends.exefrom MSVC to check the dependencies of foo.dlland see if any are missing.

尝试使用depends.exefrom MSVC 检查 的依赖项foo.dll并查看是否缺少任何依赖项。

Another option is to download and run FileMon. Then run regsvr32again and see which file/module it fails to find. This should definitely track it down.

另一种选择是下载并运行FileMon。然后regsvr32再次运行并查看它找不到哪个文件/模块。这绝对应该追踪它。

回答by ergohack

On the 64bit OSes, Dependency Walker has been uninformative for me; and FileMonhas been replaced by Process Monitor (see https://docs.microsoft.com/en-us/sysinternals/downloads/procmonto download the utility). Here is how I was able to find the missing references using Process Monitor:

在 64 位操作系统上,Dependency Walker 对我来说没有任何信息;并FileMon已被 Process Monitor 取代(请参阅https://docs.microsoft.com/en-us/sysinternals/downloads/procmon以下载该实用程序)。以下是我如何使用 Process Monitor 找到丢失的引用:

ProcMon Toolbar for the Filter Dialog

过滤器对话框的 ProcMon 工具栏

Open the Filter Dialog either from the toolbar or the menu.

从工具栏或菜单打开过滤器对话框。

ProcMon Filter Dialog

ProcMon 过滤器对话框

Add the Process Nameof regsvr32.exeto the filter list and remove any PIDfilters.

Process Nameof添加regsvr32.exe到过滤器列表并删除所有PID过滤器。

ProcMon Clear Toolbar Button

ProcMon 清除工具栏按钮

Clear the list, ...

清除清单,...

ProcMon Capture Toolbar Button

ProcMon Capture Toolbar Button

... turn on Capturing, if it is not already on.

...打开捕获,如果它尚未打开。

Run your regsvr32.execommand from a console window. Once complete, you might want to toggle the capture off.

regsvr32.exe从控制台窗口运行您的命令。完成后,您可能希望关闭捕获。

missing reference lines

missing reference lines

Look for the missing reference after regsvr32has loaded your DLL.

regsvr32加载 DLL后查找丢失的引用。