简体   繁体   English

C ++(MFC,不是.NET)应用程序的程序集重定向

[英]Assembly redirect for C++ (MFC, not .NET) application

I'm trying to perform assembly redirection for an MFC application (not .NET application). 我正在尝试为MFC应用程序(不是.NET应用程序)执行程序集重定向。
The MFC application and all external DLLs are fully isolated. MFC应用程序和所有外部DLL是完全隔离的。
MyDLL is also written using MFC. MyDLL也使用MFC编写。

Application.manifest contains a dependency to Application.manifest包含对

"MyDLL,version=1.0.0.0"

MyDLL has this assembly identity: "MyDLL,version=2.0.0.0" MyDLL具有以下程序集标识: "MyDLL,version=2.0.0.0"

Application.exe.config contains a redirection Application.exe.config包含重定向

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="MyDLL" culture="neutral" />
         <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
       </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

but this redirection is not honored. 但是不支持这种重定向。
Is it possible to perform redirection for other than .NET runtime assemblies? 是否可以为.NET运行时程序集以外的其他程序执行重定向?
If not, are there some other way to perform redirection? 如果没有,还有其他方法可以执行重定向吗?

使用<windows>标记而不是<runtime>解决了所有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM