The Wayback Machine - https://web.archive.org/web/20201016171056/https://github.com/creyke/WaitForDebugger
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

WaitForDebugger

Adds the ability to easily wait for a debugger connection before a .NET Core application executes.

Usage

  1. Add a reference to the the WaitForDebugger project (no NuGet currently).

  2. Add the following line to the top of your Program.cs Main() method:

    class Program
    {
        static void Main(string[] args)
        {
            DebuggerAwaiter.Wait(args);
        }
    }
  1. Pass the argument '-waitfordebugger' to your application to have it wait for a local or remote debugger connection before continuing execution.

Alternative Usage

You can also pass a boolean to the Wait() method if you require more granular control over when to wait for the debugger connection:

    class Program
    {
        static void Main(string[] args)
        {
            DebuggerAwaiter.Wait(true);
        }
    }

If you are going full async, you can of course do:

    class Program
    {
        static async Task Main(string[] args)
        {
            await DebuggerAwaiter.WaitAsync(args);
        }
    }

About

Adds the ability to easily wait for a debugger connection before a .NET Core application executes.

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.