/MANIFESTDEPENDENCY (Specify Manifest Dependencies)
/MANIFESTDEPENDENCY:manifest_dependency
/MANIFESTDEPENDENCY lets you specify attributes that will be placed in the <dependency> section of the manifest file.
See /MANIFEST (Create Side-by-Side Assembly Manifest) for information on how to create a manifest file.
For more information on the <dependency> section of the manifest file, see Publisher Configuration Files.
/MANIFESTDEPENDENCY information can be passed to the linker in one of two ways:
Directly on the command line (or in a response file) with /MANIFESTDEPENDENCY.
Via the comment pragma.
The following example shows a /MANIFESTDEPENDENCY comment passed via pragma,
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Test.Research.SampleAssembly' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='0000000000000000' language='*'\"")
which results in the following entry in the manifest file:
<dependency>
<dependentAssembly>
<assemblyIdentity type='Win32' name='Test.Research.SampleAssembly' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='0000000000000000' language='*' />
</dependentAssembly>
</dependency>
The same /MANIFESTDEPENDENCY comments can be passed at the command line as follows:
"/manifestdependency:type='Win32' name='Test.Research.SampleAssembly' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='0000000000000000' language='*'\"
The linker will collect /MANIFESTDEPENDENCY comments, eliminate duplicate entries, and then add the resulting XML string to the manifest file. If the linker finds conflicting entries, the manifest file will become corrupt and the application will fail to launch (an entry may be added to the event log, indicating the source of the failure).
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
Select the Configuration Properties > Linker > Manifest File property page.
Modify the Additional Manifest Dependencies property.