AssemblyInstaller.CheckIfInstallable メソッド
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)



CheckIfInstallable メソッドは、指定したアセンブリをインストールできるかどうかを判断します。例外がスローされないようにするには、ファイルが次の基準を満たしている必要があります。
![]() |
---|
アセンブリが有効であっても、インストーラが格納されていない場合は、例外がスローされます。この動作はインストール時の動作とは異なります。インストール時には、空のアセンブリをインストールしてもエラーにはなりません。 |

存在するアセンブリと存在しないアセンブリの両方に対して CheckIfInstallable メソッドを呼び出し、その結果をコンソールに表示する例を次に示します。
Imports System Imports System.Configuration.Install Class MyCheckIfInstallableClass Shared Sub Main() Try ' Determine whether the assembly 'MyAssembly' is installable. AssemblyInstaller.CheckIfInstallable("MyAssembly_CheckIfInstallable.exe") Console.WriteLine("The assembly 'MyAssembly_CheckIfInstallable' is installable") ' Determine whether the assembly 'NonExistant' is installable. AssemblyInstaller.CheckIfInstallable("NonExistant") Catch End Try End Sub 'Main End Class 'MyCheckIfInstallableClass
using System; using System.Configuration.Install; class MyCheckIfInstallableClass:Installer { static void Main() { try { // Determine whether the assembly 'MyAssembly' is installable. AssemblyInstaller.CheckIfInstallable( "MyAssembly_CheckIfInstallable.exe" ); Console.WriteLine( "The assembly 'MyAssembly_CheckIfInstallable' is installable" ); // Determine whether the assembly 'NonExistant' is installable. AssemblyInstaller.CheckIfInstallable( "NonExistant" ); } catch( Exception ) { } } }
#using <System.dll> #using <System.Configuration.Install.dll> using namespace System; using namespace System::Configuration::Install; int main() { try { // Determine whether the assembly 'MyAssembly' is installable. AssemblyInstaller::CheckIfInstallable( "MyAssembly_CheckIfInstallable.exe" ); Console::WriteLine( "The assembly 'MyAssembly_CheckIfInstallable' is installable" ); // Determine whether the assembly 'NonExistant' is installable. AssemblyInstaller::CheckIfInstallable( "NonExistant" ); } catch ( Exception^ e ) { Console::WriteLine( e ); } }
import System.*; import System.Configuration.Install.*; class MyCheckIfInstallableClass extends Installer { public static void main(String[] args) { try { // Determine whether the assembly 'MyAssembly' is installable. AssemblyInstaller.CheckIfInstallable( "MyAssembly_CheckIfInstallable.exe"); Console.WriteLine("The assembly 'MyAssembly_CheckIfInstallable' " + "is installable"); // Determine whether the assembly 'NonExistant' is installable. AssemblyInstaller.CheckIfInstallable("NonExistant"); } catch (System.Exception exp) { } } //main } //MyCheckIfInstallableClass


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からAssemblyInstaller.CheckIfInstallable メソッドを検索する場合は、下記のリンクをクリックしてください。

- AssemblyInstaller.CheckIfInstallable メソッドのページへのリンク