다음을 통해 공유


Debug.Assert 메서드

정의

조건을 확인합니다. 조건이면 false메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

오버로드

Name Description
Assert(Boolean)

조건을 확인합니다. 조건이 false면 호출 스택을 표시하는 메시지 상자를 표시합니다.

Assert(Boolean, Debug+AssertInterpolatedStringHandler)

조건을 확인합니다. 조건이면 false지정된 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

Assert(Boolean, String)

조건을 확인합니다. 조건이면 false지정된 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

Assert(Boolean, Debug+AssertInterpolatedStringHandler, Debug+AssertInterpolatedStringHandler)

조건을 확인합니다. 조건이면 false지정된 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

Assert(Boolean, String, String)

조건을 확인합니다. 조건이면 false지정된 두 개의 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

Assert(Boolean, String, String, Object[])

조건을 확인합니다. 조건이면 false두 개의 메시지(단순 및 형식)를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

Assert(Boolean)

Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs

조건을 확인합니다. 조건이 false면 호출 스택을 표시하는 메시지 상자를 표시합니다.

public:
 static void Assert(bool condition);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition);
[System.Diagnostics.Conditional("DEBUG")]
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static void Assert(bool condition);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool -> unit
[<System.Diagnostics.Conditional("DEBUG")>]
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member Assert : bool -> unit
Public Shared Sub Assert (condition As Boolean)

매개 변수

condition
Boolean

계산할 조건부 식입니다. 조건이면 true오류 메시지가 전송되지 않고 메시지 상자가 표시되지 않습니다.

특성

예제

다음 예제에서는 배열에 대한 인덱스를 만들고 인덱스 값을 설정하는 몇 가지 작업을 수행한 다음 인덱스 값이 유효한지 확인하기 위해 호출 Assert 합니다. 유효 Assert 하지 않으면 호출 스택을 출력합니다.

// Create an index for an array.
int index;

// Perform some action that sets the index.
index = -40;

// Test that the index value is valid.
Debug.Assert(index > -1);
' Create an index for an array.
Dim index As Integer

' Perform some action that sets the index.
index = -40

' Test that the index value is valid. 
Debug.Assert((index > - 1))

설명

기본적으로 이 메서드는 Debug.Assert 디버그 빌드에서만 작동합니다. 릴리스 빌드에서 Trace.Assert 어설션을 수행하려면 이 메서드를 사용합니다. 자세한 내용은 관리 코드 어설션을 참조하세요.

일반적으로 Assert(Boolean) 이 메서드는 프로그램 개발 중에 논리 오류를 식별하는 데 사용됩니다. Assert 는 조건을 평가합니다. 결과가 있으면 false컬렉션에 실패 메시지를 Listeners 보냅니다. 컬렉션을 추가 TraceListener 하거나 컬렉션에서 Listeners 제거하여 이 동작을 사용자 지정할 수 있습니다.

애플리케이션이 사용자 인터페이스 모드에서 실행되면 파일 및 줄 번호가 있는 호출 스택을 표시하는 메시지 상자가 표시됩니다. 메시지 상자에는 중단, 다시 시도무시라는 세 개의 단추가 있습니다. 중단 단추를 클릭하면 애플리케이션이 종료됩니다. 다시 시도를 클릭하면 애플리케이션이 디버거에서 실행 중인 경우 디버거의 코드로 보내거나, 그렇지 않은 경우 디버거를 열도록 제안합니다. 무시를 클릭하면 코드의 다음 명령이 계속됩니다.

메모

Windows 8.x 앱은 모달 대화 상자를 지원하지 않으므로 사용자 인터페이스 모드 및 비 사용자 인터페이스 모드에서 동일하게 동작합니다. 메시지는 디버깅 모드에서 활성 추적 수신기에 기록되거나 릴리스 모드로 작성된 메시지가 없습니다.

메모

메시지 상자의 표시는 .의 DefaultTraceListener존재에 따라 달라집니다. 컬렉션에 DefaultTraceListenerListeners 없는 경우 메시지 상자가 표시되지 않습니다. DefaultTraceListener 속성(System.Diagnostics.Trace.Listeners.Clear())에서 Listeners 메서드를 Clear 호출하여 제거할 수 있습니다. .NET Framework 앱의 경우 앱의 <구성 파일에서 clear> 요소<제거> 요소를 사용할 수도 있습니다.

.NET Framework 앱의 경우 애플리케이션의 이름에 DefaultTraceListener 해당하는 구성 파일의 동작을 변경할 수 있습니다. 이 파일에서 어설션 메시지 상자를 사용하거나 사용하지 않도록 설정하거나 속성을 설정할 DefaultTraceListener.LogFileName 수 있습니다. 구성 파일의 형식은 다음과 같이 지정해야 합니다.

<configuration>
  <system.diagnostics>
    <assert assertuienabled="true" logfilename="c:\\myFile.log" />
  </system.diagnostics>
</configuration>

추가 정보

적용 대상

Assert(Boolean, Debug+AssertInterpolatedStringHandler)

Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs

조건을 확인합니다. 조건이면 false지정된 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

public:
 static void Assert(bool condition, System::Diagnostics::Debug::AssertInterpolatedStringHandler % message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, ref System.Diagnostics.Debug.AssertInterpolatedStringHandler message);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool * AssertInterpolatedStringHandler -> unit
Public Shared Sub Assert (condition As Boolean, ByRef message As Debug.AssertInterpolatedStringHandler)

매개 변수

condition
Boolean

계산할 조건부 식입니다. 조건이면 true지정된 메시지가 전송되지 않고 메시지 상자가 표시되지 않습니다.

message
Debug.AssertInterpolatedStringHandler

컬렉션에 보낼 메시지입니다 Listeners .

특성

설명

이 오버로드는 성능을 향상시키기 위해 .NET 6에 도입되었습니다. 매개 변수를 사용하는 String 오버로드와 비교하여 이 오버로드는 메시지가 필요한 경우에만 보간된 문자열 서식 항목을 평가합니다.

기본적으로 이 메서드는 Debug.Assert 디버그 빌드에서만 작동합니다. 릴리스 빌드에서 Trace.Assert 어설션을 수행하려면 이 메서드를 사용합니다. 자세한 내용은 관리 코드 어설션을 참조하세요.

일반적으로 Assert 이 메서드는 프로그램 개발 중에 논리 오류를 식별하는 데 사용됩니다. Assert 는 조건을 평가합니다. 결과가 있으면 false지정된 진단 메시지를 컬렉션에 Listeners 보냅니다. 컬렉션을 추가 TraceListener 하거나 컬렉션에서 Listeners 제거하여 이 동작을 사용자 지정할 수 있습니다.

애플리케이션이 사용자 인터페이스 모드에서 실행되면 파일 및 줄 번호가 있는 호출 스택을 표시하는 메시지 상자가 표시됩니다. 메시지 상자에는 중단, 다시 시도무시라는 세 개의 단추가 있습니다. 중단 단추를 클릭하면 애플리케이션이 종료됩니다. 다시 시도를 클릭하면 애플리케이션이 디버거에서 실행 중인 경우 디버거의 코드로 보내거나, 그렇지 않은 경우 디버거를 열도록 제안합니다. 무시를 클릭하면 코드의 다음 명령이 계속됩니다.

메모

메시지 상자의 표시는 .의 DefaultTraceListener존재에 따라 달라집니다. 컬렉션에 DefaultTraceListenerListeners 없는 경우 메시지 상자가 표시되지 않습니다. DefaultTraceListener 속성(System.Diagnostics.Trace.Listeners.Clear())에서 Listeners 메서드를 Clear 호출하여 제거할 수 있습니다. .NET Framework 앱의 경우 앱의 <구성 파일에서 clear> 요소<제거> 요소를 사용할 수도 있습니다.

.NET Framework 앱의 경우 애플리케이션의 이름에 DefaultTraceListener 해당하는 구성 파일의 동작을 변경할 수 있습니다. 이 파일에서 어설션 메시지 상자를 사용하거나 사용하지 않도록 설정하거나 속성을 설정할 DefaultTraceListener.LogFileName 수 있습니다. 구성 파일의 형식은 다음과 같이 지정해야 합니다.

<configuration>
  <system.diagnostics>
    <assert assertuienabled="true" logfilename="c:\\myFile.log" />
  </system.diagnostics>
</configuration>

추가 정보

적용 대상

Assert(Boolean, String)

Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs

조건을 확인합니다. 조건이면 false지정된 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

public:
 static void Assert(bool condition, System::String ^ message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, string message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, string? message = default);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, string? message);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool * string -> unit
Public Shared Sub Assert (condition As Boolean, message As String)
Public Shared Sub Assert (condition As Boolean, Optional message As String = Nothing)

매개 변수

condition
Boolean

계산할 조건부 식입니다. 조건이면 true지정된 메시지가 전송되지 않고 메시지 상자가 표시되지 않습니다.

message
String

컬렉션에 보낼 메시지입니다 Listeners .

특성

예제

다음 예제에서는 매개 변수가 type 유효한지 확인합니다. 이 nullAssert 경우 type 메시지를 출력합니다.

public static void MyMethod(Type type, Type baseType)
{
    Debug.Assert(type != null, "Type parameter is null");

    // Perform some processing.
}
Public Shared Sub MyMethod(type As Type, baseType As Type)
    Debug.Assert(Not (type Is Nothing), "Type parameter is null")
End Sub

설명

기본적으로 이 메서드는 Debug.Assert 디버그 빌드에서만 작동합니다. 릴리스 빌드에서 Trace.Assert 어설션을 수행하려면 이 메서드를 사용합니다. 자세한 내용은 관리 코드 어설션을 참조하세요.

일반적으로 Assert 이 메서드는 프로그램 개발 중에 논리 오류를 식별하는 데 사용됩니다. Assert 는 조건을 평가합니다. 결과가 있으면 false지정된 진단 메시지를 컬렉션에 Listeners 보냅니다. 컬렉션을 추가 TraceListener 하거나 컬렉션에서 Listeners 제거하여 이 동작을 사용자 지정할 수 있습니다.

애플리케이션이 사용자 인터페이스 모드에서 실행되면 파일 및 줄 번호가 있는 호출 스택을 표시하는 메시지 상자가 표시됩니다. 메시지 상자에는 중단, 다시 시도무시라는 세 개의 단추가 있습니다. 중단 단추를 클릭하면 애플리케이션이 종료됩니다. 다시 시도를 클릭하면 애플리케이션이 디버거에서 실행 중인 경우 디버거의 코드로 보내거나, 그렇지 않은 경우 디버거를 열도록 제안합니다. 무시를 클릭하면 코드의 다음 명령이 계속됩니다.

메모

메시지 상자의 표시는 .의 DefaultTraceListener존재에 따라 달라집니다. 컬렉션에 DefaultTraceListenerListeners 없는 경우 메시지 상자가 표시되지 않습니다. DefaultTraceListener 속성(System.Diagnostics.Trace.Listeners.Clear())에서 Listeners 메서드를 Clear 호출하여 제거할 수 있습니다. .NET Framework 앱의 경우 앱의 <구성 파일에서 clear> 요소<제거> 요소를 사용할 수도 있습니다.

.NET Framework 앱의 경우 애플리케이션의 이름에 DefaultTraceListener 해당하는 구성 파일의 동작을 변경할 수 있습니다. 이 파일에서 어설션 메시지 상자를 사용하거나 사용하지 않도록 설정하거나 속성을 설정할 DefaultTraceListener.LogFileName 수 있습니다. 구성 파일의 형식은 다음과 같이 지정해야 합니다.

<configuration>
  <system.diagnostics>
    <assert assertuienabled="true" logfilename="c:\\myFile.log" />
  </system.diagnostics>
</configuration>

추가 정보

적용 대상

Assert(Boolean, Debug+AssertInterpolatedStringHandler, Debug+AssertInterpolatedStringHandler)

Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs

조건을 확인합니다. 조건이면 false지정된 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

public:
 static void Assert(bool condition, System::Diagnostics::Debug::AssertInterpolatedStringHandler % message, System::Diagnostics::Debug::AssertInterpolatedStringHandler % detailMessage);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, ref System.Diagnostics.Debug.AssertInterpolatedStringHandler message, ref System.Diagnostics.Debug.AssertInterpolatedStringHandler detailMessage);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool * AssertInterpolatedStringHandler * AssertInterpolatedStringHandler -> unit
Public Shared Sub Assert (condition As Boolean, ByRef message As Debug.AssertInterpolatedStringHandler, ByRef detailMessage As Debug.AssertInterpolatedStringHandler)

매개 변수

condition
Boolean

계산할 조건부 식입니다. 조건이면 true지정된 메시지가 전송되지 않고 메시지 상자가 표시되지 않습니다.

message
Debug.AssertInterpolatedStringHandler

컬렉션에 보낼 메시지입니다 Listeners .

detailMessage
Debug.AssertInterpolatedStringHandler

컬렉션에 보낼 자세한 메시지입니다 Listeners .

특성

설명

이 오버로드는 성능을 향상시키기 위해 .NET 6에 도입되었습니다. 매개 변수를 사용하는 String 오버로드와 비교하여 이 오버로드는 메시지가 필요한 경우에만 보간된 문자열 서식 항목을 평가합니다.

기본적으로 이 메서드는 Debug.Assert 디버그 빌드에서만 작동합니다. 릴리스 빌드에서 Trace.Assert 어설션을 수행하려면 이 메서드를 사용합니다. 자세한 내용은 관리 코드 어설션을 참조하세요.

일반적으로 Assert 이 메서드는 프로그램 개발 중에 논리 오류를 식별하는 데 사용됩니다. Assert 는 조건을 평가합니다. 결과가 있으면 false지정된 진단 메시지를 컬렉션에 Listeners 보냅니다. 컬렉션을 추가 TraceListener 하거나 컬렉션에서 Listeners 제거하여 이 동작을 사용자 지정할 수 있습니다.

애플리케이션이 사용자 인터페이스 모드에서 실행되면 파일 및 줄 번호가 있는 호출 스택을 표시하는 메시지 상자가 표시됩니다. 메시지 상자에는 중단, 다시 시도무시라는 세 개의 단추가 있습니다. 중단 단추를 클릭하면 애플리케이션이 종료됩니다. 다시 시도를 클릭하면 애플리케이션이 디버거에서 실행 중인 경우 디버거의 코드로 보내거나, 그렇지 않은 경우 디버거를 열도록 제안합니다. 무시를 클릭하면 코드의 다음 명령이 계속됩니다.

메모

메시지 상자의 표시는 .의 DefaultTraceListener존재에 따라 달라집니다. 컬렉션에 DefaultTraceListenerListeners 없는 경우 메시지 상자가 표시되지 않습니다. DefaultTraceListener 속성(System.Diagnostics.Trace.Listeners.Clear())에서 Listeners 메서드를 Clear 호출하여 제거할 수 있습니다. .NET Framework 앱의 경우 앱의 <구성 파일에서 clear> 요소<제거> 요소를 사용할 수도 있습니다.

.NET Framework 앱의 경우 애플리케이션의 이름에 DefaultTraceListener 해당하는 구성 파일의 동작을 변경할 수 있습니다. 이 파일에서 어설션 메시지 상자를 사용하거나 사용하지 않도록 설정하거나 속성을 설정할 DefaultTraceListener.LogFileName 수 있습니다. 구성 파일의 형식은 다음과 같이 지정해야 합니다.

<configuration>
  <system.diagnostics>
    <assert assertuienabled="true" logfilename="c:\\myFile.log" />
  </system.diagnostics>
</configuration>

추가 정보

적용 대상

Assert(Boolean, String, String)

Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs

조건을 확인합니다. 조건이면 false지정된 두 개의 메시지를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

public:
 static void Assert(bool condition, System::String ^ message, System::String ^ detailMessage);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, string message, string detailMessage);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, string? message, string? detailMessage);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool * string * string -> unit
Public Shared Sub Assert (condition As Boolean, message As String, detailMessage As String)

매개 변수

condition
Boolean

계산할 조건부 식입니다. 조건이면 true지정된 메시지가 전송되지 않고 메시지 상자가 표시되지 않습니다.

message
String

컬렉션에 보낼 메시지입니다 Listeners .

detailMessage
String

컬렉션에 보낼 자세한 메시지입니다 Listeners .

특성

예제

다음 예제에서는 매개 변수가 type 유효한지 확인합니다. 이 nullAssert 경우 type 두 개의 메시지를 출력합니다.

public static void MyMethod(Type type, Type baseType)
{
    Debug.Assert(type != null, "Type parameter is null",
       "Can't get object for null type");

    // Perform some processing.
}
Public Shared Sub MyMethod(type As Type, baseType As Type)
    Debug.Assert( Not (type Is Nothing), "Type parameter is null", "Can't get object for null type")
    ' Perform some processing.
End Sub

설명

기본적으로 이 메서드는 Debug.Assert 디버그 빌드에서만 작동합니다. 릴리스 빌드에서 Trace.Assert 어설션을 수행하려면 이 메서드를 사용합니다. 자세한 내용은 관리 코드 어설션을 참조하세요.

일반적으로 Assert(Boolean, String, String) 이 메서드는 프로그램 개발 중에 논리 오류를 식별하는 데 사용됩니다. Assert 는 조건을 평가합니다. 결과가 있으면 false지정된 진단 메시지와 자세한 메시지를 컬렉션에 Listeners 보냅니다. 컬렉션을 추가 TraceListener 하거나 컬렉션에서 Listeners 제거하여 이 동작을 사용자 지정할 수 있습니다.

애플리케이션이 사용자 인터페이스 모드에서 실행되면 파일 및 줄 번호가 있는 호출 스택을 표시하는 메시지 상자가 표시됩니다. 메시지 상자에는 중단, 다시 시도무시라는 세 개의 단추가 있습니다. 중단 단추를 클릭하면 애플리케이션이 종료됩니다. 다시 시도를 클릭하면 애플리케이션이 디버거에서 실행 중인 경우 디버거의 코드로 보내거나, 그렇지 않은 경우 디버거를 열도록 제안합니다. 무시를 클릭하면 코드의 다음 명령이 계속됩니다.

메모

메시지 상자의 표시는 .의 DefaultTraceListener존재에 따라 달라집니다. 컬렉션에 DefaultTraceListenerListeners 없는 경우 메시지 상자가 표시되지 않습니다. DefaultTraceListener 속성(System.Diagnostics.Trace.Listeners.Clear())에서 Listeners 메서드를 Clear 호출하여 제거할 수 있습니다. .NET Framework 앱의 경우 앱의 <구성 파일에서 clear> 요소<제거> 요소를 사용할 수도 있습니다.

.NET Framework 앱의 경우 애플리케이션의 이름에 DefaultTraceListener 해당하는 구성 파일의 동작을 변경할 수 있습니다. 이 파일에서 어설션 메시지 상자를 사용하거나 사용하지 않도록 설정하거나 속성을 설정할 DefaultTraceListener.LogFileName 수 있습니다. 구성 파일의 형식은 다음과 같이 지정해야 합니다.

<configuration>
  <system.diagnostics>
    <assert assertuienabled="true" logfilename="c:\\myFile.log" />
  </system.diagnostics>
</configuration>

추가 정보

적용 대상

Assert(Boolean, String, String, Object[])

Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs
Source:
Debug.cs

조건을 확인합니다. 조건이면 false두 개의 메시지(단순 및 형식)를 출력하고 호출 스택을 표시하는 메시지 상자를 표시합니다.

public:
 static void Assert(bool condition, System::String ^ message, System::String ^ detailMessageFormat, ... cli::array <System::Object ^> ^ args);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, string message, string detailMessageFormat, params object[] args);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition, string? message, string detailMessageFormat, params object?[] args);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool * string * string * obj[] -> unit
Public Shared Sub Assert (condition As Boolean, message As String, detailMessageFormat As String, ParamArray args As Object())

매개 변수

condition
Boolean

계산할 조건부 식입니다. 조건이면 true지정된 메시지가 전송되지 않고 메시지 상자가 표시되지 않습니다.

message
String

컬렉션에 보낼 메시지입니다 Listeners .

detailMessageFormat
String

컬렉션에 보낼 복합 형식 문자열입니다 Listeners . 이 메시지에는 배열의 개체에 해당하는 0개 이상의 서식 항목이 섞인 텍스트가 args 포함되어 있습니다.

args
Object[]

서식을 지정할 개체가 0개 이상 포함된 개체 배열입니다.

특성

설명

이 메서드는 .NET 복합 서식 지정 기능을 사용하여 개체 값을 텍스트 표현으로 변환하고 해당 표현을 문자열에 포함합니다. 결과 문자열이 컬렉션으로 Listeners 전송됩니다.

기본적으로 이 메서드는 Debug.Assert 디버그 빌드에서만 작동합니다. 릴리스 빌드에서 Trace.Assert 어설션을 수행하려면 이 메서드를 사용합니다. 자세한 내용은 관리 코드 어설션을 참조하세요.

일반적으로 Assert(Boolean, String, String, Object[]) 이 메서드는 프로그램 개발 중에 논리 오류를 식별하는 데 사용됩니다. Assert 는 조건을 평가합니다. 결과가 있으면 false메서드가 String.Format(String, Object[]) 호출되고 detailMessageFormat 문자열과 args 배열이 매개 변수로 전달됩니다. Assert(Boolean, String, String, Object[]) 지정된 문자 메시지와 서식이 지정된 문자 메시지를 컬렉션에 Listeners 보냅니다. 컬렉션을 추가 TraceListener 하거나 컬렉션에서 Listeners 제거하여 이 동작을 사용자 지정할 수 있습니다.

애플리케이션이 사용자 인터페이스 모드에서 실행되면 파일 및 줄 번호가 있는 호출 스택을 표시하는 메시지 상자가 표시됩니다. 메시지 상자에는 중단, 다시 시도무시라는 세 개의 단추가 있습니다. 중단 단추를 클릭하면 애플리케이션이 종료됩니다. 다시 시도를 클릭하면 애플리케이션이 디버거에서 실행 중인 경우 디버거의 코드로 보내거나, 그렇지 않은 경우 디버거를 열도록 제안합니다. 무시를 클릭하면 코드의 다음 명령이 계속됩니다.

메모

메시지 상자의 표시는 .의 DefaultTraceListener존재에 따라 달라집니다. 컬렉션에 DefaultTraceListenerListeners 없는 경우 메시지 상자가 표시되지 않습니다. DefaultTraceListener 속성(System.Diagnostics.Trace.Listeners.Clear())에서 Listeners 메서드를 Clear 호출하여 제거할 수 있습니다. .NET Framework 앱의 경우 앱의 <구성 파일에서 clear> 요소<제거> 요소를 사용할 수도 있습니다.

.NET Framework 앱의 경우 애플리케이션의 이름에 DefaultTraceListener 해당하는 구성 파일의 동작을 변경할 수 있습니다. 이 파일에서 어설션 메시지 상자를 사용하거나 사용하지 않도록 설정하거나 속성을 설정할 DefaultTraceListener.LogFileName 수 있습니다. 구성 파일의 형식은 다음과 같이 지정해야 합니다.

<configuration>
  <system.diagnostics>
    <assert assertuienabled="true" logfilename="c:\\myFile.log" />
  </system.diagnostics>
</configuration>

적용 대상