XmlException コンストラクター

定義

XmlException クラスの新しいインスタンスを初期化します。

オーバーロード

XmlException()

XmlException クラスの新しいインスタンスを初期化します。

XmlException(String)

指定したエラー メッセージを使用して、XmlException クラスの新しいインスタンスを初期化します。

XmlException(SerializationInfo, StreamingContext)
古い.

SerializationInfo オブジェクトおよび StreamingContext オブジェクトの情報を使用して、XmlException クラスの新しいインスタンスを初期化します。

XmlException(String, Exception)

XmlException クラスの新しいインスタンスを初期化します。

XmlException(String, Exception, Int32, Int32)

指定したメッセージ、内部例外、行番号、行の位置を使用して、XmlException クラスの新しいインスタンスを初期化します。

XmlException()

Source:
XmlException.cs
Source:
XmlException.cs
Source:
XmlException.cs

XmlException クラスの新しいインスタンスを初期化します。

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

注釈

XmlExceptionは、XML 処理中に問題が発生した場合にスローされる、XML 関連の汎用エラーです。 次の例では、連絡先>の終了タグのスペルが間違っているため、<XML 例外をスローします。

using System;
using System.Xml.Linq;

try
{
    XElement contacts = XElement.Parse(
        @"<Contacts>
            <Contact>
                <Name>Jim Wilson</Name>
            </Contact>
          </Contcts>");
    Console.WriteLine(contacts);
}
catch (System.Xml.XmlException e)
{
    Console.WriteLine(e.Message);
}
Try
    Dim contacts As XElement = XElement.Parse(
        "<Contacts>  
            <Contact>  
                <Name>Jim Wilson</Name>  
            </Contact>  
         </Contcts>")
    Console.WriteLine(contacts)
Catch e As System.Xml.XmlException
    Console.WriteLine(e.Message)
End Try

適用対象

XmlException(String)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
XmlException.cs

指定したエラー メッセージを使用して、XmlException クラスの新しいインスタンスを初期化します。

public:
 XmlException(System::String ^ message);
public XmlException (string message);
public XmlException (string? message);
new System.Xml.XmlException : string -> System.Xml.XmlException
Public Sub New (message As String)

パラメーター

message
String

エラーの説明。

適用対象

XmlException(SerializationInfo, StreamingContext)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
XmlException.cs

注意事項

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

SerializationInfo オブジェクトおよび StreamingContext オブジェクトの情報を使用して、XmlException クラスの新しいインスタンスを初期化します。

protected:
 XmlException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected XmlException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected XmlException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Xml.XmlException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Xml.XmlException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Xml.XmlException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Xml.XmlException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

パラメーター

info
SerializationInfo

SerializationInfo のすべてのプロパティを格納している XmlException オブジェクト。

context
StreamingContext

コンテキスト情報を格納している StreamingContext オブジェクト。

属性

適用対象

XmlException(String, Exception)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
XmlException.cs

XmlException クラスの新しいインスタンスを初期化します。

public:
 XmlException(System::String ^ message, Exception ^ innerException);
public XmlException (string message, Exception innerException);
public XmlException (string? message, Exception? innerException);
new System.Xml.XmlException : string * Exception -> System.Xml.XmlException
Public Sub New (message As String, innerException As Exception)

パラメーター

message
String

エラー状態の説明。

innerException
Exception

Exception をスローした XmlException (存在する場合)。 この値は、null の場合もあります。

適用対象

XmlException(String, Exception, Int32, Int32)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
XmlException.cs

指定したメッセージ、内部例外、行番号、行の位置を使用して、XmlException クラスの新しいインスタンスを初期化します。

public:
 XmlException(System::String ^ message, Exception ^ innerException, int lineNumber, int linePosition);
public XmlException (string message, Exception innerException, int lineNumber, int linePosition);
public XmlException (string? message, Exception? innerException, int lineNumber, int linePosition);
new System.Xml.XmlException : string * Exception * int * int -> System.Xml.XmlException
Public Sub New (message As String, innerException As Exception, lineNumber As Integer, linePosition As Integer)

パラメーター

message
String

エラーの説明。

innerException
Exception

現在の例外の原因となった例外。 この値は、null の場合もあります。

lineNumber
Int32

エラーの発生場所を示す行番号。

linePosition
Int32

エラーの発生場所を示す行の位置。

適用対象