Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,

I have created an application that builds a DLL along with an EXE that references several delivered runtime DLL's. The built DLL and EXE have been built with VS2012, and the delivered runtime DLL have been built with VS2010. When I attempt to execute the application, I will receive an access violation in WinMain (the call to AfxGetThread returns NULL). Just to verify the application, if the delivered runtime DLLs were also built with VS2012, the application executes successfully.

My goal is the execute the application without relinking it.

Is there a way to utilize a manifest config file, using <assemblyidentity> and <bindingredirect> to change the references to VS2010 (made by the runtime DLLs) to VS2012 so that the application can be executed without relinking?

Here is the config file that I created, but was not successful:

XML
<configuration>
   <windows>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
         <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.VC100.MFC" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
            <bindingRedirect oldVersion="10.0.40219.325" newVersion="11.0.60610.1" />
            <assemblyIdentity type="win32" name="Microsoft.VC100.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
            <bindingRedirect oldVersion="10.0.40219.325" newVersion="11.0.51106.1" />
         </dependentAssembly>
      </assemblyBinding>
   </windows>
</configuration>


I am not sure if assembly names Microsoft.VS100.MFC and Microsoft.VS100.CRT are actually valid, and also not sure if I can redirect between major VS releases.

I have not been able to find any working examples. Any assistance would be helpful.

Regards, Rob
Posted
Comments
Sergey Alexandrovich Kryukov 5-Jun-15 11:20am    
Why? why?!
—SA
Jochen Arndt 5-Jun-15 12:10pm    
Install the MFC runtime of the VS version that has been used to build your app.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900