Using Side-by-Side Assemblies as a Resource

You can add a manifest to a application as a resource in the application's binary executable header file. The value of the MANIFEST_RESOURCE_ID determines how the side-by-side assembly dependencies described in the manifest are used by the loader.

If you set the MANIFEST_RESOURCE_ID to 1, the loader uses the side-by-side assembly dependencies specified in the manifest as the process default. All plug-ins also use this process default.

The following table summarizes how the loader uses the manifest for different values of MANIFEST_RESOURCE_ID when the application is compiled with the -DISOLATION_AWARE_ENABLED flag. Note that the values 1-16 are reserved for use by Windows XP. A developer may use other values if they wish to manage the activation contexts using the functions describe in the Activation Context Reference.

Value of MANIFEST_RESOURCE_ID Manifest specifies the Process Default? Use for Static Imports? Use for an EXE? Use for a DLL? Uses Side-by-Side version of assemblies if compiled with -DISOLATION_AWARE_ENABLED?
1 Yes Yes Yes No Yes
2 No Yes Yes Yes Yes
3 No No Yes Yes Yes

 

MANIFEST_RESOURCE_ID 1 should be used for applications that do not host plug-ins. Use MANIFEST_RESOURCE_ID 1 when all parts of the application should use the version of the side-by-side assembly specified in the manifest. For more information, see Enabling an Assembly in an Application Without Extensions.

MANIFEST_RESOURCE_ID 2 should be used for applications that host third-party controls or plug-ins. In this case, the manifest affects all side-by-side assemblies being loaded by static loading, calls to DllMain, and calls redirected by -DISOLATION_AWARE_ENABLED. For more information, see Enabling an Assembly in an Application Hosting a DLL, Extension, or Control Panel.

MANIFEST_RESOURCE_ID 3 should be used for redirecting calls by -DISOLATION_AWARE_ENABLED only. Loading by other methods are unaffected.