Visual Studio 2010 installs version ...4974 of the VC9 runtime whose .pdbs are unavailable. How can I force my GME.exe
to use an older VC9 runtime?
I've tried putting this into GME.exe.config
:
<?xml version="1.0"?>
<configuration>
<windows>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity type="win32" name="GME" processorArchitecture="x86" version="1.0.0.1"/>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" publicKeyToken="1fc8b3b9a1e18e3b" processorArchitecture="x86" />
<bindingRedirect oldVersion="9.0.21022.8-9.0.21022.4974" newVersion="9.0.30729.4148" />
<bindingRedirect oldVersion="9.0.30729.0-9.0.30729.4974" newVersion="9.0.30729.4148" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.MFC" publicKeyToken="1fc8b3b9a1e18e3b" processorArchitecture="x86" />
<bindingRedirect oldVersion="9.0.21022.8-9.0.21022.4974" newVersion="9.0.30729.4148" />
<bindingRedirect oldVersion="9.0.30729.0-9.0.30729.4974" newVersion="9.0.30729.4148" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.ATL" publicKeyToken="1fc8b3b9a1e18e3b" processorArchitecture="x86" />
<bindingRedirect oldVersion="9.0.21022.8-9.0.21022.4974" newVersion="9.0.30729.4148" />
<bindingRedirect oldVersion="9.0.30729.0-9.0.30729.4974" newVersion="9.0.30729.4148" />
</dependentAssembly>
</assemblyBinding>
</windows>
</configuration>
However, sxstrace reports:
INFO: Resolving reference Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
....
INFO: Publisher Policy redirected assembly version.
Adding <publisherPolicy apply="no"/>
under <dependentAssembly>
results in ERROR: Activation Context generation failed.
with no other helpful information on Windows 7.
Note this is only for debugging my local copy, not redistribution, so I'm not worried about security updates or other benefits of the publisher policy.
Here's the trick to get the Application Config to work with Win2003 and later:
http://www.tech-archive.net/Archive/VC/microsoft.public.vc.ide_general/2008-01/msg00033.html
Essentially, one needs to add the app to the compatibility database with "EnableAppConfig"
This is documented here:
http://msdn.microsoft.com/en-us/library/ee710783%28VS.85%29.aspx
Working GME.exe.Config
:
<?xml version="1.0"?>
<configuration>
<windows>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<publisherPolicy apply="no"/>
<bindingRedirect oldVersion="9.0.21022.0-9.0.21022.4974" newVersion="9.0.30729.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.MFC" publicKeyToken="1fc8b3b9a1e18e3b" processorArchitecture="x86"/>
<publisherPolicy apply="no"/>
<bindingRedirect oldVersion="9.0.21022.0-9.0.21022.4974" newVersion="9.0.30729.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.ATL" publicKeyToken="1fc8b3b9a1e18e3b" processorArchitecture="x86"/>
<publisherPolicy apply="no"/>
<bindingRedirect oldVersion="9.0.21022.0-9.0.21022.4974" newVersion="9.0.30729.1" />
</dependentAssembly>
</assemblyBinding>
</windows>
</configuration>
It seems one needs to do this for loaded .dlls too.