XmlException 생성자

정의

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

오버로드

XmlException()

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

XmlException(String)

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

XmlException(SerializationInfo, StreamingContext)
사용되지 않음.

SerializationInfoStreamingContext 개체의 정보를 사용하여 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 처리 중에 문제가 발생하는 경우 throw되는 일반적인 XML 관련 오류입니다. 다음 예제에서는 연락처 끝 태그의 철자가 <틀렸기 때문에 XML 예외를 throw합니다> .

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.

SerializationInfoStreamingContext 개체의 정보를 사용하여 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을 throw한 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

오류가 발생한 곳을 나타내는 줄 위치입니다.

적용 대상