https://github.com/creyke/waitfordebugger
Adds the ability to easily wait for a debugger connection before a .NET Core application executes.
https://github.com/creyke/waitfordebugger
debugger debugging dotnet-core remote-debug
Last synced: 2 months ago
JSON representation
Adds the ability to easily wait for a debugger connection before a .NET Core application executes.
- Host: GitHub
- URL: https://github.com/creyke/waitfordebugger
- Owner: creyke
- License: mit
- Created: 2018-01-23T17:08:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-29T10:15:21.000Z (over 7 years ago)
- Last Synced: 2025-02-12T05:47:31.809Z (4 months ago)
- Topics: debugger, debugging, dotnet-core, remote-debug
- Language: C#
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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);
}
}
```3. 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);
}
}
```