InstallException 생성자

정의

InstallException 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
InstallException()

InstallException 클래스의 새 인스턴스를 초기화합니다.

InstallException(String)

클래스의 새 인스턴스를 InstallException 초기화하고 사용자에게 표시할 메시지를 지정합니다.

InstallException(SerializationInfo, StreamingContext)

직렬화된 데이터를 사용하여 클래스의 새 인스턴스를 InstallException 초기화합니다.

InstallException(String, Exception)

클래스의 새 인스턴스를 InstallException 초기화하고 사용자에게 표시할 메시지와 이 예외의 원인인 내부 예외에 대한 참조를 지정합니다.

InstallException()

InstallException 클래스의 새 인스턴스를 초기화합니다.

public:
 InstallException();
public InstallException();
Public Sub New ()

예제

다음 예제에서는 생성자를 보여 줍니다 InstallException . 클래스 예제의 InstallException 일부입니다.

이 예제에서는 Installutil.exe 메서드를 호출합니다 Commit . 이 코드는 Commit 어셈블리 설치를 커밋하기 전에 이름이 지정된 FileDoesNotExist.txt 파일이 있다고 가정합니다. 파일이 FileDoesNotExist.txtCommitInstallException으면 .

메모

이 예제에서는 생성자의 오버로드된 버전 InstallException 중 하나를 사용하는 방법을 보여줍니다. 사용할 수 있는 다른 예제는 개별 오버로드 항목을 참조하세요.

virtual void Commit( IDictionary^ savedState ) override
{
   Installer::Commit( savedState );
   Console::WriteLine( "Commit ..." );
   
   // Throw an error if a particular file doesn't exist.
   if (  !File::Exists( "FileDoesNotExist.txt" ) )
         throw gcnew InstallException;

   
   // Perform the final installation if the file exists.
}
public override void Commit(IDictionary savedState)
{
   base.Commit(savedState);
   Console.WriteLine("Commit ...");
   // Throw an error if a particular file doesn't exist.
   if(!File.Exists("FileDoesNotExist.txt"))
      throw new InstallException();
   // Perform the final installation if the file exists.
}
Public Overrides Sub Commit(savedState As IDictionary)
   MyBase.Commit(savedState)
   Console.WriteLine("Commit ...")
   ' Throw an error if a particular file doesn't exist.
   If Not File.Exists("FileDoesNotExist.txt") Then
      Throw New InstallException()
   End If
   ' Perform the final installation if the file exists.
End Sub

적용 대상

InstallException(String)

클래스의 새 인스턴스를 InstallException 초기화하고 사용자에게 표시할 메시지를 지정합니다.

public:
 InstallException(System::String ^ message);
public InstallException(string message);
new System.Configuration.Install.InstallException : string -> System.Configuration.Install.InstallException
Public Sub New (message As String)

매개 변수

message
String

사용자에게 표시할 메시지입니다.

예제

다음 예제에서는 생성자를 보여 줍니다 InstallException . 클래스 예제의 InstallException 일부입니다.

이 예제에서는 Installutil.exe 메서드를 호출합니다 Uninstall . 제거는 이름이 지정된 FileDoesNotExist.txt 파일이 있는 경우에만 발생합니다. 그렇지 않으면 InstallException.

메모

이 예제에서는 생성자의 오버로드된 버전 InstallException 중 하나를 사용하는 방법을 보여줍니다. 사용할 수 있는 다른 예제는 개별 오버로드 항목을 참조하세요.

virtual void Uninstall( IDictionary^ savedState ) override
{
   Installer::Uninstall( savedState );
   Console::WriteLine( "UnInstall ..." );
   
   // Throw an error if a particular file doesn't exist.
   if (  !File::Exists( "FileDoesNotExist.txt" ) )
         throw gcnew InstallException( "The file 'FileDoesNotExist'  does not exist" );

   
   // Perform the uninstall activites if the file exists.
}
public override void Uninstall(IDictionary savedState)
{
   base.Uninstall(savedState);
   Console.WriteLine("UnInstall ...");
   // Throw an error if a particular file doesn't exist.
   if(!File.Exists("FileDoesNotExist.txt"))
      throw new InstallException("The file 'FileDoesNotExist'" +
         " does not exist");
   // Perform the uninstall activites if the file exists.
}
Public Overrides Sub Uninstall(savedState As IDictionary)
   MyBase.Uninstall(savedState)
   Console.WriteLine("UnInstall ...")
   ' Throw an error if a particular file doesn't exist.
   If Not File.Exists("FileDoesNotExist.txt") Then
      Throw New InstallException("The file 'FileDoesNotExist'" + " does not exist")
   End If
   ' Perform the uninstall activites if the file exists.
End Sub

적용 대상

InstallException(SerializationInfo, StreamingContext)

직렬화된 데이터를 사용하여 클래스의 새 인스턴스를 InstallException 초기화합니다.

protected:
 InstallException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected InstallException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Configuration.Install.InstallException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Configuration.Install.InstallException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

매개 변수

info
SerializationInfo

throw되는 예외에 대한 직렬화된 개체 데이터를 보유하는 SerializationInfo.

context
StreamingContext

원본 또는 대상에 대한 컨텍스트 정보가 포함된 StreamingContext.

적용 대상

InstallException(String, Exception)

클래스의 새 인스턴스를 InstallException 초기화하고 사용자에게 표시할 메시지와 이 예외의 원인인 내부 예외에 대한 참조를 지정합니다.

public:
 InstallException(System::String ^ message, Exception ^ innerException);
public InstallException(string message, Exception innerException);
new System.Configuration.Install.InstallException : string * Exception -> System.Configuration.Install.InstallException
Public Sub New (message As String, innerException As Exception)

매개 변수

message
String

사용자에게 표시할 메시지입니다.

innerException
Exception

현재 예외의 원인인 예외입니다. 매개 변수가 innerException 아닌 null경우 내부 예외를 catch 처리하는 블록에서 현재 예외가 발생합니다.

적용 대상