ContractHelper Class

.NET Framework 4.6 and 4.5

Provides methods that the binary rewriter uses to handle contract failures.


Namespace:  System.Runtime.CompilerServices
Assemblies:   System.Diagnostics.Contracts (in System.Diagnostics.Contracts.dll)
  mscorlib (in mscorlib.dll)

public static class ContractHelper

The ContractHelper type exposes the following members.

Public methodStatic memberRaiseContractFailedEventUsed by the binary rewriter to activate the default failure behavior.
Public methodStatic memberTriggerFailureTriggers the default failure behavior.

.NET Framework

Supported in: 4.6, 4.5

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft