gpt4 book ai didi

windows - 每个应用程序配置文件 bindingRedirect 不适用于 Dll

转载 作者:可可西里 更新时间:2023-11-01 14:44:38 25 4
gpt4 key购买 nike

我创建了一个简单的 Win32 应用程序,通过包含对版本 6 commctl32.dll 的明显依赖来演示 XP 上的 UXtheme然后我创建了一个简单的 Win32 dll,使用 ISOLATION_AWARE_ENABLED 构建它,并使用指定 Comctl32.dll 版本 5 和 6 的嵌入式 list 对其进行测试

我使用这种方法成功地让 exe 和 dll 使用不同版本的 comctl32.dll。 exe 使用 5 和 dll 版本 6,反之亦然。

然后,我重置应用程序和 dll 以具有 comctl ver 5 list 依赖项。并引入了一个应用配置文件:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
<windows>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df"/>
<bindingRedirect oldVersion="5.82.7100.0" newVersion="6.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</windows>
</configuration>

现在,当我运行我的应用程序时,应用程序显然被重定向到 commctl v6 - 使用启用的 XP UXTheme 可以清楚地显示对话框。但是,dll 没有被重定向,而是使用 commctl 的非主题版本 5。

文档中没有提到用于执行 bindingRedirects 的每个 dll 配置文件。尝试创建一个不会做任何事情。

我也知道从程序集的一个主要版本到另一个版本的 bindingRedirect 不受支持,但我实际上只是使用 commctl32 作为测试机制的一种明显简单的方法。

如何重定向 dll 的依赖程序集的版本?

最佳答案

And Windows Vista won't even access .manifest or .config files that are added later as it caches their existence along with a date-time stamp for the exe.

我发现注销/登录似乎清除了再次读取配置文件的触发器。

关于windows - 每个应用程序配置文件 bindingRedirect 不适用于 Dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1347713/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com