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

속성 값

어셈블리를 설치하기 위해 InstallContext 개체를 새로 만들어야 하면 true이고, 그렇지 않으면 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 "{Assembly name}이라는 새 파일이 만들어집니다. InstallLog"를 사용하여 이 어셈블리에 대한 메시지를 기록합니다. 를 로 false 설정 UseNewContext 하면 새 파일이 만들어지는 것을 방지합니다.

적용 대상