NativeImage Element

WiX Help

NativeImage Element

Description

Improves the performance of managed applications by creating native images. Requires the .NET Framework 2.0 to be installed on the target machine since it runs NGen.

Windows Installer references
None
Parents
File
Inner Text
None
Children
None
Attributes
Name Type Description Required
Id String The identifier for this NativeImage. Yes
AppBaseDirectory String The identifier of the directory to use for locating dependent assemblies. For DLL assemblies and assemblies installed to the GAC, this attribute should be set to the directory of the application which loads this assembly. For EXE assemblies, this attribute does not need to be set because NGen will use the directory of the assembly file by default.  
AssemblyApplication String The identifier of the application which will load this assembly. For DLL assemblies which are loaded via reflection, this attribute should be set to indicate the application which will load this assembly. The configuration of the application (usually specified via an exe.config file) will be used to determine how to resolve dependencies for this assembly. When a shared component is loaded at run time, using the Load method, the application's configuration file determines the dependencies that are loaded for the shared component — for example, the version of a dependency that is loaded. This attribute gives guidance on which dependencies would be loaded at run time in order to figure out which dependency assemblies will also need to have native images generated (assuming the Dependency attribute is not set to "no"). This attribute cannot be set if the AssemblyApplication attribute is set on the parent File element (please note that these attributes both refer to the same application assembly but do very different things: specifiying File/@AssemblyApplication will force an assembly to install to a private location next to the indicated application, whereas this AssemblyApplication attribute will be used to help resolve dependent assemblies while generating native images for this assembly).  
Debug YesNoType Set to "yes" to generate native images that can be used under a debugger. The default value is "no".  
Dependencies YesNoType Set to "no" to generate the minimum number of native images. The default value is "yes".  
Platform Enumeration Sets the platform(s) for which native images will be generated. This attribute's value should be one of the following:
32bit
Generate native images only for the 32-bit version of the .NET Framework on the target machine. This is the default value.
64bit
Generate native images only for the ia64 or x86 version of the .NET Framework on the target machine. If no 64-bit .NET Framework is available on the target machine, attempting to generate native images will fail.
all
Generate native images for all platforms of the .NET Framework available on the target machine.
 
Priority Enumeration Sets the priority of generating the native images for this assembly. This attribute's value should be one of the following:
0
This is the highest priority, it means that image generation occurs syncronously during the setup process. This option will slow down setup performance.
1
This will queue image generation to the NGen service to occur immediately. This option will slow down setup performance.
2
This will queue image generation to the NGen service to occur after all priority 1 assemblies have completed. This option will slow down setup performance.
3
This is the lowest priority, it will queue image generation to occur when the machine is idle. This option should not slow down setup performance. This is the default value.
 
Profile YesNoType Set to "yes" to generate native images that can be used under a profiler. The default value is "no".  
Remarks
Native images are files containing compiled processor-specific machine code, which are installed into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.
See Also
Netfx Schema