アセンブリのインストール用に新しい InstallContext オブジェクトを作成するかどうかを示す値を取得または設定します。
Public Property UseNewContext As Boolean
[C#]
public bool UseNewContext {get; set;}
[C++]
public: __property bool get_UseNewContext();public: __property void set_UseNewContext(bool);
[JScript]
public function get UseNewContext() : Boolean;public function set UseNewContext(Boolean);
プロパティ値
アセンブリのインストール用に新しい InstallContext オブジェクトを作成する場合は true 。それ以外の場合は false 。既定値は true です。
解説
このプロパティを true に設定すると、アセンブリに関するメッセージのログを記録するために、"{Assembly name}.InstallLog" という名前の新しいファイルが作成されます。 UseNewContext を false に設定すると、新しいファイルは作成されません。
使用例
[Visual Basic, C#, C++] 次の例では、 AssemblyInstaller コンストラクタの呼び出しによって AssemblyInstaller が作成されます。このオブジェクトの UseNewContext プロパティが true に設定され、 Install メソッドが MyAssembly_HelpText.exe
アセンブリに対して呼び出されます。これにより、ログ メッセージがコンソールに表示されます。
' 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
[C#]
// Create an object of the 'AssemblyInstaller' class.
AssemblyInstaller myAssemblyInstaller = new
AssemblyInstaller( "MyAssembly_HelpText.exe", commandLineOptions );
// Set the 'UseNewContext' property to true.
myAssemblyInstaller.UseNewContext = true;
[C++]
// Create an Object* of the 'AssemblyInstaller' class.
AssemblyInstaller* myAssemblyInstaller =
new AssemblyInstaller(S"MyAssembly_HelpText.exe", commandLineOptions);
// Set the 'UseNewContext' property to true.
myAssemblyInstaller->UseNewContext = true;
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
AssemblyInstaller クラス | AssemblyInstaller メンバ | System.Configuration.Install 名前空間