Partilhar via


AssemblyInstaller.UseNewContext Propriedade

Definição

Obtém ou define um valor que indica se deve ser criado um novo objeto InstallContext para a instalação do assembly.

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

Valor da propriedade

true se um novo InstallContext objeto deve ser criado para a instalação do assembly; caso contrário, false. O padrão é true.

Exemplos

No exemplo a seguir, um AssemblyInstaller é criado invocando o AssemblyInstaller construtor . A UseNewContext propriedade desse objeto é definida como true e o Install método é invocado no MyAssembly_HelpText.exe assembly. Devido a isso, as mensagens de log são exibidas no 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

Comentários

Definir essa propriedade para true criar um novo arquivo chamado "{Nome do assembly}. InstallLog" para registrar mensagens para este assembly. A configuração UseNewContext para false impede que o novo arquivo seja criado.

Aplica-se a