加载DLL具有依赖关系的依赖性的dll
我的情况是:
- a.dll取决于b.dll和c.dll
- b.dll取决于c.dll
- 的文件夹下方的子文件夹中
b.dll和c.dll位于包含A.dll b.dll和c.dll 在带有以下清单的组件(bcAssembly)内部:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="AssemblyBC" version="1.0.0.0"/>
<file name="B.dll"/>
<file name="C.dll"/>
</assembly>
a.dll取决于A.Dll代码中定义的汇总BC,
#pragma comment(linker, "/manifestdependency:\"name='AssemblyBC' version='1.0.0.0' type='win32'\"")
当我加载A.DLL时,我会获得错误代码126(“找不到指定的模块”) 。我已经通过 Process Monitor 成功找到了B.Dll和C.dll,但是B.Dll找不到c.dll。我尝试添加一个b.dll.manifest指定对汇编的依赖性,但这没有效果,也许是因为b.dll在assemblybc内部。如何使用清单使B.Dll找到c.dll?
My situation is:
- A.dll depends on B.dll and C.dll
- B.dll depends on C.dll
- B.dll and C.dll are in a subfolder below the folder containing A.dll
B.dll and C.dll are inside an assembly (BCAssembly) with the following manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="AssemblyBC" version="1.0.0.0"/>
<file name="B.dll"/>
<file name="C.dll"/>
</assembly>
A.dll depends on AssemblyBC via its manifest, defined in A.dll's code:
#pragma comment(linker, "/manifestdependency:\"name='AssemblyBC' version='1.0.0.0' type='win32'\"")
When I load A.dll, I get error code 126 ("Specified module could not be found"). I have confirmed via Process Monitor that A.dll uses the manifest to successfully find B.dll and C.dll, but B.dll cannot find C.dll. I tried adding a B.dll.manifest specifying a dependency on AssemblyBC, but this had no effect, perhaps because B.dll is inside AssemblyBC. How can I use manifests to make B.dll find C.dll?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论