Task.Exception 속성

정의

AggregateException가 중간에 종료되도록 하는 Task을 가져옵니다. Task가 완료되었거나 예외를 아직 throw하지 않았을 경우 null을 반환합니다.

public:
 property AggregateException ^ Exception { AggregateException ^ get(); };
public AggregateException Exception { get; }
public AggregateException? Exception { get; }
member this.Exception : AggregateException
Public ReadOnly Property Exception As AggregateException

속성 값

AggregateException

AggregateException가 중간에 종료되도록 하는 Task입니다.

설명

처리되지 않은 예외를 throw하는 태스크는 결과 예외를 저장하고 속성에 AggregateException 대한 액세스에 대한 호출 Wait 에서 래핑된 예외를 Exception 전파합니다. .NET Framework 4.0에서는 태스크 인스턴스가 가비지 수집될 때까지 관찰되지 않은 예외가 종료자 스레드에서 전파되어 프로세스가 충돌합니다. .NET Framework 4.5 이상에서는 관찰되지 않은 예외가 종료자에서 다시 throw되지 않도록 기본 동작이 변경되었습니다. .NET Core는 종료자에서 예외를 다시 throw하지 않습니다. 자세한 내용과 예제는 예외 처리(작업 병렬 라이브러리)를 참조하세요.

적용 대상