What is the manifest file of the vs program?
Manifest is a list of dependent side-by-side components, such as ATL and CRT.
Why is there a manifest file?
On a PC, there are usually more than one version number (C:/Windows/winsxs or in the system folder) when a program is loaded, therefore, the manifest file is used to specify.
Where and how to create a manifest.
Suppose vs is used for development, you can set to manually create manifest by using porperty-> Configuration properties-> linker-> manifest file-> Generate manifest to yes to specify the system and CRT assembly version.
In addition to the external manifest file, the embedded manifest information can be written to the generated binary file.
Set porperty-> Configuration properties-> manifest tool-> embed manifest to Yes
For Windows Versions earlier than XP, external manifest has a higher priority than embed manifest, but for Windows Server and later versions, the opposite is true.
Why does my manifest clearly indicate
Name = "Microsoft. vc80.debugcrt" version = "8.0.50608.0 ",
The depends.exe tool can be used, but we found that 8.00.50727.42 is referenced?
In C:/Windows/winsxs/policies, a publisher configuration file is also called a policy file. For example, the 8.0.50727.42.policy file redirects the dependency:
<Dependentassembly>
<Assemblyidentity type = "Win32" name = "Microsoft. vc80.debugcrt" processorarchitecture = "IA64" publickeytoken = "1fc8b3b9a1e18e3b"/>
<Bindingredirect oldversion = "8.0.41204.256-8.0.50608.0" newversion = "8.0.50727.42"/>
</Dependentassembly>
Specify that "8.0.41204.256-8.0.50608.0" is directed to 8.0.50727.42. This is a solution provided by the Assembly provider, such as MS, to fix low-level version bugs. In addition, you can use the application config file to redirect the assembly of the program. For example, in your bin local directory yourbin. extention. config:
<Configuration>
<Windows>
<Assemblybinding xmlns = "urn: Schemas-Microsoft-com: ASM. V1">
<Dependentassembly>
<Assemblyidentity type = "Win32" name = "Microsoft. vc80.atl" processorarchitecture = "x86" publickeytoken = "1fc8b3b9a1e18e3b"> </assemblyidentity>
<Bindingredirect oldversion = "8.0.41204.256-8.0.50608.0" newversion = "8.0.50727.42"/>
</Dependentassembly>
<Dependentassembly>
<Assemblyidentity type = "Win32" name = "Microsoft. vc80.debugcrt" processorarchitecture = "x86" publickeytoken = "1fc8b3b9a1e18e3b"/> </assemblyidentity>
<Bindingredirect oldversion = "8.0.41204.256-8.0.50608.0" newversion = "8.0.50727.42"/>
</Dependentassembly>
</Assemblybinding>
</Windows>
</Configuration>
How does one determine the assembly version number specified by the manifest information of my program?
In the Assembly header file, the Assembly version number is specified. Such as crtassem. h.
# Ifndef _ crt_assembly_version
# DEFINE _ crt_assembly_version "8.0.50608.0"
# Endif
You can change 8.0.50608.0 to 8.0.50727.42 to generate the desired manifest information.
What if I want to publish my program as an Independent Assembly (isolated application) without relying on the system assembly of the target PC?
Take the dependent assembly and the corresponding manifest file (C:/Windows/winsxs) with it. Note that the manifest information must be directly specified to the attached assembly DLLs, you do not need to rely on policy redirection.