RegistrationException 클래스

정의

등록 오류가 검색될 때 throw되는 예외입니다.

public ref class RegistrationException sealed : SystemException
[System.Serializable]
public sealed class RegistrationException : SystemException
[<System.Serializable>]
type RegistrationException = class
    inherit SystemException
Public NotInheritable Class RegistrationException
Inherits SystemException
상속
RegistrationException
특성

예제

다음 코드 예제에는 등록 예외를 처리하는 방법을 보여 주는 catch 블록이 포함되어 있습니다.

try
{
   String^ applicationName = "Queued Component";
   String^ typeLibraryName = nullptr;
   RegistrationHelper^ helper = gcnew RegistrationHelper;
   // Call the InstallAssembly method passing it the name of the assembly to 
   // install as a COM+ application, the COM+ application name, and 
   // the name of the type library file.
   // Setting the application name and the type library to NULL (nothing in Visual Basic .NET
   // allows you to use the COM+ application name that is given in the assembly and 
   // the default type library name. The application name in the assembly metadata 
   // takes precedence over the application name you provide to InstallAssembly. 
   helper->InstallAssembly( "C:..\\..\\QueuedComponent.dll",  applicationName,  typeLibraryName, InstallationFlags::CreateTargetApplication );
   Console::WriteLine( "Registration succeeded: Type library {0} created.", typeLibraryName );
   Console::Read();

   // Create a RegistrationConfig object and set its attributes
   // Create a RegistrationHelper object, and call the InstallAssemblyFromConfig
   // method by passing the RegistrationConfiguration object to it as a 
   // reference object
   RegistrationConfig^ registrationConfiguration = gcnew RegistrationConfig;
   registrationConfiguration->AssemblyFile = "C:..\\..\\QueuedComponent.dll";
   registrationConfiguration->Application = "MyApp";
   registrationConfiguration->InstallationFlags = InstallationFlags::CreateTargetApplication;
   RegistrationHelper^ helperFromConfig = gcnew RegistrationHelper;
   helperFromConfig->InstallAssemblyFromConfig(  registrationConfiguration );
}
catch ( RegistrationException^ e ) 
{
   Console::WriteLine( e->Message );

   // Check whether the ErrorInfo property of the RegistrationException object is null. 
   // If there is no extended error information about 
   // methods related to multiple COM+ objects ErrorInfo will be null.
   if ( e->ErrorInfo != nullptr )
   {
      // Gets an array of RegistrationErrorInfo objects describing registration errors
      array<RegistrationErrorInfo^>^ registrationErrorInfos = e->ErrorInfo;
      
      // Iterate through the array of RegistrationErrorInfo objects and disply the 
      // ErrorString for each object.
      System::Collections::IEnumerator^ myEnum = registrationErrorInfos->GetEnumerator();
      while ( myEnum->MoveNext() )
      {
         RegistrationErrorInfo^ registrationErrorInfo = (RegistrationErrorInfo^)( myEnum->Current );
         Console::WriteLine( registrationErrorInfo->ErrorString );
      }
   }
   Console::Read();
}
try
{
    string applicationName = "Queued Component";			
    string typeLibraryName = null;
    RegistrationHelper helper = new RegistrationHelper();
    // Call the InstallAssembly method passing it the name of the assembly to
    // install as a COM+ application, the COM+ application name, and
    // the name of the type library file.
    // Setting the application name and the type library to NULL (nothing in Visual Basic .NET
    // allows you to use the COM+ application name that is given in the assembly and
    // the default type library name. The application name in the assembly metadata
    // takes precedence over the application name you provide to InstallAssembly.
    helper.InstallAssembly(@"C:..\..\QueuedComponent.dll", ref applicationName, ref typeLibraryName, InstallationFlags.CreateTargetApplication);
    Console.WriteLine("Registration succeeded: Type library {0} created.", typeLibraryName);
    Console.Read();

    // Create a RegistrationConfig object and set its attributes
    // Create a RegistrationHelper object, and call the InstallAssemblyFromConfig
    // method by passing the RegistrationConfiguration object to it as a
    // reference object
    RegistrationConfig registrationConfiguration = new RegistrationConfig();
    registrationConfiguration.AssemblyFile=@"C:..\..\QueuedComponent.dll";
    registrationConfiguration.Application = "MyApp";
    registrationConfiguration.InstallationFlags = InstallationFlags.CreateTargetApplication;
    RegistrationHelper helperFromConfig = new RegistrationHelper();
    helperFromConfig.InstallAssemblyFromConfig(ref registrationConfiguration);
}

catch(RegistrationException e)
{
    Console.WriteLine(e.Message);

    // Check whether the ErrorInfo property of the RegistrationException object is null.
    // If there is no extended error information about
    // methods related to multiple COM+ objects ErrorInfo will be null.
    if(e.ErrorInfo != null)
    {
        // Gets an array of RegistrationErrorInfo objects describing registration errors
        RegistrationErrorInfo[] registrationErrorInfos = e.ErrorInfo;

        // Iterate through the array of RegistrationErrorInfo objects and disply the
        // ErrorString for each object.

        foreach (RegistrationErrorInfo registrationErrorInfo in registrationErrorInfos)
        {
            Console.WriteLine(registrationErrorInfo.ErrorString);
        }
    }
    Console.Read();
}
Try
    Dim applicationName As String = "Queued Component"
    Dim typeLibraryName As String = Nothing
    Dim helper As New RegistrationHelper

    ' Call the InstallAssembly method passing it the name of the assembly to 
    ' install as a COM+ application, the COM+ application name, and 
    ' the name of the type library file.
    ' Setting the application name and the type library to NULL (nothing in Visual Basic .NET
    ' allows you to use the COM+ application name that is given in the assembly and 
    ' the default type library name. The application name in the assembly metadata 
    ' takes precedence over the application name you provide to InstallAssembly. 
    helper.InstallAssembly("C:..\..\QueuedComponent.dll", applicationName, typeLibraryName, InstallationFlags.CreateTargetApplication)
    MsgBox("Registration succeeded: Type library " & typeLibraryName & " created.")
    Console.Read()

    ' Create a RegistrationConfig object and set its attributes
    ' Create a RegistrationHelper object, and call the InstallAssemblyFromConfig
    ' method by passing the RegistrationConfiguration object to it as a 
    ' reference object
    Dim registrationConfiguration As New RegistrationConfig()
    registrationConfiguration.AssemblyFile = "C:..\..\QueuedComponent.dll"
    registrationConfiguration.Application = "MyApp"
    registrationConfiguration.InstallationFlags = InstallationFlags.CreateTargetApplication
    Dim helperFromConfig As New RegistrationHelper()
    helperFromConfig.InstallAssemblyFromConfig(registrationConfiguration)

Catch e As RegistrationException
    MsgBox(e.Message)

    ' Check whether the ErrorInfo property of the RegistrationException object is null. 
    ' If there is no extended error information about 
    ' methods related to multiple COM+ objects ErrorInfo will be null.
    If Not (e.ErrorInfo Is Nothing) Then
        ' Gets an array of RegistrationErrorInfo objects describing registration errors
        Dim registrationErrorInfos As RegistrationErrorInfo() = e.ErrorInfo

        ' Iterate through the array of RegistrationErrorInfo objects and disply the 
        ' ErrorString for each object.
        Dim registrationErrorInfo As RegistrationErrorInfo
        For Each registrationErrorInfo In registrationErrorInfos
            MsgBox(registrationErrorInfo.ErrorString)
        Next registrationErrorInfo
    End If
    Console.Read()
End Try

생성자

RegistrationException()

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

RegistrationException(String)

지정된 오류 메시지를 사용하여 RegistrationException 클래스의 새 인스턴스를 초기화합니다.

RegistrationException(String, Exception)

지정된 오류 메시지와 중첩 예외를 사용하여 RegistrationException 클래스의 새 인스턴스를 초기화합니다.

속성

Data

예외에 대한 사용자 정의 정보를 추가로 제공하는 키/값 쌍 컬렉션을 가져옵니다.

(다음에서 상속됨 Exception)
ErrorInfo

등록 오류를 설명하는 RegistrationErrorInfo 개체의 배열을 가져옵니다.

HelpLink

이 예외와 연결된 도움말 파일에 대한 링크를 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
HResult

특정 예외에 할당된 코드화된 숫자 값인 HRESULT를 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
InnerException

현재 예외를 발생시킨 Exception 인스턴스를 가져옵니다.

(다음에서 상속됨 Exception)
Message

현재 예외를 설명하는 메시지를 가져옵니다.

(다음에서 상속됨 Exception)
Source

오류를 발생시키는 애플리케이션 또는 개체의 이름을 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
StackTrace

호출 스택의 직접 실행 프레임 문자열 표현을 가져옵니다.

(다음에서 상속됨 Exception)
TargetSite

현재 예외를 throw하는 메서드를 가져옵니다.

(다음에서 상속됨 Exception)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetBaseException()

파생 클래스에서 재정의된 경우 하나 이상의 후속 예외의 근본 원인이 되는 Exception 을 반환합니다.

(다음에서 상속됨 Exception)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetObjectData(SerializationInfo, StreamingContext)

SerializationInfo의 오류 정보를 사용하여 RegistrationErrorInfo 개체를 설정합니다.

GetType()

현재 인스턴스의 런타임 형식을 가져옵니다.

(다음에서 상속됨 Exception)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 예외에 대한 문자열 표현을 만들고 반환합니다.

(다음에서 상속됨 Exception)

이벤트

SerializeObjectState
사용되지 않음.

예외에 대한 serialize된 데이터가 들어 있는 예외 상태 개체가 만들어지도록 예외가 serialize될 때 발생합니다.

(다음에서 상속됨 Exception)

적용 대상