RegistrationException Klasse

Definition

Die Ausnahme, die bei Feststellung eines Registrierungsfehlers ausgelöst wird.The exception that is thrown when a registration error is detected.

public ref class RegistrationException sealed : SystemException
[System.Serializable]
public sealed class RegistrationException : SystemException
type RegistrationException = class
    inherit SystemException
Public NotInheritable Class RegistrationException
Inherits SystemException
Vererbung
RegistrationException
Attribute

Beispiele

Das folgende Codebeispiel enthält einen catch-Block, der zeigt, wie eine Registrierungs Ausnahme behandelt wird.The following code example contains a catch block that shows how to handle a registration exception.

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

Konstruktoren

RegistrationException()

Initialisiert eine neue Instanz der RegistrationException-Klasse.Initializes a new instance of the RegistrationException class.

RegistrationException(String)

Initialisiert eine neue Instanz der RegistrationException-Klasse mit einer angegebenen Fehlermeldung.Initializes a new instance of the RegistrationException class with a specified error message.

RegistrationException(String, Exception)

Initialisiert eine neue Instanz der RegistrationException-Klasse mit der angegebenen Fehlermeldung und der angegebenen geschachtelten Ausnahme.Initializes a new instance of the RegistrationException class with a specified error message and nested exception.

Eigenschaften

Data

Ruft eine Auflistung von Schlüssel-Wert-Paaren ab, die zusätzliche benutzerdefinierte Informationen über die Ausnahme bereitstellen.Gets a collection of key/value pairs that provide additional user-defined information about the exception.

(Geerbt von Exception)
ErrorInfo

Ruft ein Array von RegistrationErrorInfo-Objekten mit einer Beschreibung von Registrierungsfehlern ab.Gets an array of RegistrationErrorInfo objects that describe registration errors.

HelpLink

Ruft einen Link zur Hilfedatei ab, die dieser Ausnahme zugeordnet ist, oder legt einen Link fest.Gets or sets a link to the help file associated with this exception.

(Geerbt von Exception)
HResult

Ruft HRESULT ab oder legt HRESULT fest. Dies ist ein codierter Wert, der einer bestimmten Ausnahme zugeordnet ist.Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

(Geerbt von Exception)
InnerException

Ruft die Exception-Instanz ab, die die aktuelle Ausnahme verursacht hat.Gets the Exception instance that caused the current exception.

(Geerbt von Exception)
Message

Ruft eine Meldung ab, die die aktuelle Ausnahme beschreibt.Gets a message that describes the current exception.

(Geerbt von Exception)
Source

Gibt den Namen der Anwendung oder des Objekts zurück, die bzw. das den Fehler verursacht hat, oder legt diesen fest.Gets or sets the name of the application or the object that causes the error.

(Geerbt von Exception)
StackTrace

Ruft eine Zeichenfolgendarstellung der unmittelbaren Frames in der Aufrufliste ab.Gets a string representation of the immediate frames on the call stack.

(Geerbt von Exception)
TargetSite

Ruft die Methode ab, die die aktuelle Ausnahme auslöst.Gets the method that throws the current exception.

(Geerbt von Exception)

Methoden

Equals(Object)

Ermittelt, ob das angegebene Objekt und das aktuelle Objekt gleich sind.Determines whether the specified object is equal to the current object.

(Geerbt von Object)
GetBaseException()

Gibt beim Überschreiben in einer abgeleiteten Klasse eine Exception zurück, die die ursprüngliche Ursache für eine oder mehrere nachfolgende Ausnahmen ist.When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.

(Geerbt von Exception)
GetHashCode()

Dient als die Standard-HashfunktionServes as the default hash function.

(Geerbt von Object)
GetObjectData(SerializationInfo, StreamingContext)

Legt das SerializationInfo-Objekt mit den Fehlerinformationen von RegistrationErrorInfo fest.Sets the SerializationInfo object with the error information in RegistrationErrorInfo.

GetType()

Ruft den Laufzeittyp der aktuellen Instanz ab.Gets the runtime type of the current instance.

(Geerbt von Exception)
MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.Creates a shallow copy of the current Object.

(Geerbt von Object)
ToString()

Erstellt eine Zeichenfolgendarstellung der aktuellen Ausnahme und gibt diese zurück.Creates and returns a string representation of the current exception.

(Geerbt von Exception)

Ereignisse

SerializeObjectState

Tritt auf, wenn eine Ausnahme serialisiert wird, um ein Ausnahmezustandsobjekt mit serialisierten Daten über die Ausnahme zu erstellen.Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception.

(Geerbt von Exception)

Gilt für: