Break Method
Collapse the table of content
Expand the table of content

Debugger.Break Method ()


Signals a breakpoint to an attached debugger.

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

public static void Break()

Exception Condition

The System.Security.Permissions.UIPermission is not set to break into the debugger.

If no debugger is attached, users are asked if they want to attach a debugger. If yes, the debugger is started. If a debugger is attached, the debugger is signaled with a user breakpoint event, and the debugger suspends execution of the process just as if a debugger breakpoint had been hit.

The following code example demonstrates how to stop the debugger at the call to WriteLine.

Console.WriteLine("Hello, world.");

for permission to start a debugger. Associated enumeration: PermissionState.Unrestricted


for operating with unmanaged code. Associated enumeration: SecurityPermissionFlag.UnmanagedCode Security action: Demand.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft