Although I’m sure that Christopher answers and the sample code (thanks Christopher!) Is part of a more elegant solution, we were under the gun to get it out of the door and found a very similar, but different, solution.
The first step is to create a manifest for the assembly:
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> </assembly>
Then you need to set the “Create manifest” parameter to “No” in the section “Configuration properties” → “Linker” → “Manifest file” and set the parameter “Insert manifest” to “No” in the section “Configuration properties” → “Manifest tool” → "Manifest"> Entry and exit.
Finally, to get a new manifest in the assembly, add the following command to the post-build phase of the project:
mt.exe /manifest "$(ProjectDir)cppassembly.dll.manifest" /outputresource:"$(TargetDir)\cppassembly.dll";
After the build, we can open the DLL in Visual Studio to view the manifest under RT_MANIFEST and confirm that it has our manifest!
When I put the Christopher code in stdafx.h, he added it as an additional dependency ... the manifest was still looking for v8.0.50727.762. The generated manifest looked like this:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> </assembly>
I could not track another switch that removes or clears existing dependencies. I like that Christopher is better than a step after assembly, but for now it works. If anyone has any further information on how to clear any existing dependencies that would be good.
Thanks!
source share