Contract.Assert Method

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

In debug builds, performs a run-time test for a specified condition.

Namespace:   System.Diagnostics.Contracts
Assembly:  mscorlib (in mscorlib.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAssert(Boolean)

Checks for a condition; if the condition is false, follows the escalation policy set for the analyzer.

System_CAPS_pubmethodSystem_CAPS_staticAssert(Boolean, String)

Checks for a condition; if the condition is false, follows the escalation policy set by the analyzer and displays the specified message.

Return to top
Show: