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
Regsvr32 fails to find the dll in the current folder
提问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.dll
has a depenency on bar.dll
and it's actually bar.dll
that can't be found.
如果foo.dll
有依赖关系,bar.dll
并且实际上bar.dll
无法找到,则可能会发生这种情况。
Try using depends.exe
from MSVC to check the dependencies of foo.dll
and see if any are missing.
尝试使用depends.exe
from MSVC 检查 的依赖项foo.dll
并查看是否缺少任何依赖项。
Another option is to download and run FileMon. Then run regsvr32
again 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 FileMon
has 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 找到丢失的引用:
Open the Filter Dialog either from the toolbar or the menu.
从工具栏或菜单打开过滤器对话框。
Add the Process Name
of regsvr32.exe
to the filter list and remove any PID
filters.
将Process Name
of添加regsvr32.exe
到过滤器列表并删除所有PID
过滤器。
Clear the list, ...
清除清单,...
... turn on Capturing, if it is not already on.
...打开捕获,如果它尚未打开。
Run your regsvr32.exe
command from a console window. Once complete, you might want to toggle the capture off.
regsvr32.exe
从控制台窗口运行您的命令。完成后,您可能希望关闭捕获。
Look for the missing reference after regsvr32
has loaded your DLL.
regsvr32
加载 DLL后查找丢失的引用。