Бөлісу құралы:


AssemblyInstaller.UseNewContext Свойство

Определение

Возвращает или задает значение, указывающее, следует ли создать новый InstallContext объект для установки сборки.

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

Значение свойства

trueЗначение , falseесли для установки сборки должен быть создан новый InstallContext объект; в противном случае . Значение по умолчанию — true.

Примеры

В следующем примере AssemblyInstaller создается объект путем вызова конструктора AssemblyInstaller . Для UseNewContext этого объекта задано true свойство, и Install метод вызывается в сборке MyAssembly_HelpText.exe . Из-за этого сообщения журнала отображаются на консоли.

// 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

Комментарии

Задание этого свойства для true создания нового файла с именем {Имя сборки}. InstallLog" для регистрации сообщений для этой сборки. Параметр UseNewContext , чтобы предотвратить false создание нового файла.

Применяется к