Bewerken

Delen via


AssemblyInstaller.UseNewContext Property

Definition

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

public:
 property bool UseNewContext { bool get(); void set(bool value); };
public bool UseNewContext { get; set; }
member this.UseNewContext : bool with get, set
Public Property UseNewContext As Boolean

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.

// Create an Object* of the 'AssemblyInstaller' class.
AssemblyInstaller^ myAssemblyInstaller = gcnew AssemblyInstaller(
   "MyAssembly_HelpText.exe", commandLineOptions );

// Set the 'UseNewContext' property to true.
myAssemblyInstaller->UseNewContext = true;
// Create an object of the 'AssemblyInstaller' class.
AssemblyInstaller myAssemblyInstaller = new
               AssemblyInstaller( "MyAssembly_HelpText.exe", commandLineOptions );

// Set the 'UseNewContext' property to true.
myAssemblyInstaller.UseNewContext = true;
' Create an object of the 'AssemblyInstaller' class.
Dim myAssemblyInstaller As _
   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