【发布时间】:2018-02-27 18:14:01
【问题描述】:
我有两个关于激活上下文 API 和 SxS 清单的问题。它们看起来很简单,但我仍然无法为它们找到任何好的答案。
我有两个文件名为 foo.dll 和 bar.dll 的 dll 库,它们都带有嵌入式清单,foo 依赖于 bar。有没有办法为这两个分配文件名以外的 assemblyIdentity 名称?例如,如果我希望 bar.dll 的程序集标识为 CompanyName.Subsection.bar ?如果我像这样更改它的身份 - 我在尝试加载 foo.dll "Dependent Assembly CompanyName.Subsection.bar,type="win32",version="0.1.2.3" could not be found" 时出错。当然,如果我将名称程序集标识指定为文件名 (<assemblyIdentity name="bar"),一切正常,但有没有办法使用这些带点的名称?
foo.dll
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="foo" version="0.1.2.3" type="win32"/>
<dependency>
<dependentAssembly>
<assemblyIdentity name="CompanyName.Subsection.bar" version="0.1.2.3" type="win32" />
</dependentAssembly>
</dependency>
<file name="foo.dll">
</file>
</assembly>
bar.dll
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="CompanyName.Subsection.bar" version="0.1.2.3" type="win32"/>
<file name="bar.dll">
</file>
</assembly>
【问题讨论】:
标签: c++ dll winsxs sxs activation-context-api