AssemblyInstaller.UseNewContext Property

Definition

Gets or sets a value indicating whether to create a new InstallContext object for the assembly's installation.

C#
public bool UseNewContext { get; set; }

Property Value

true if a new InstallContext object should be created for the assembly's installation; otherwise, false. The default is true.

Examples

In the following example, an AssemblyInstaller is created by invoking the AssemblyInstaller constructor. The UseNewContext property of this object is set to true and the Install method is invoked on the MyAssembly_HelpText.exe assembly. Due to this, the log messages are displayed on the console.

C#
// Create an object of the 'AssemblyInstaller' class.
AssemblyInstaller myAssemblyInstaller = new
               AssemblyInstaller( "MyAssembly_HelpText.exe", commandLineOptions );

// Set the 'UseNewContext' property to true.
myAssemblyInstaller.UseNewContext = true;

Remarks

Setting this property to true creates a new file named "{Assembly name}.InstallLog" to log messages for this assembly. Setting UseNewContext to false prevents the new file from being created.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1