Share via


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設定され、アセンブリで InstallMyAssembly_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すると、新しいファイルが作成されなくなります。

適用対象