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, если для установки сборки должен быть создан новый объект InstallContext, иначе — false. Значение по умолчанию — 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 новый файл не создается.

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