if(System.Diagnostics.Debugger.IsAttached)
{
// ...
}
More Related Contents:
- How do I remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning?
- Where to learn about VS debugger ‘magic names’
- C# if/then directives for debug vs release
- Where does System.Diagnostics.Debug.Write output appear?
- What is the best way to dump entire objects to a log in C#?
- What is the purpose of the vshost.exe file?
- Why is cross thread operation exception not thrown while running exe in bin\Debug
- Debug vs. Release performance
- Attach debugger in C# to another process
- What is a thread exit code?
- Unhandled exceptions in BackgroundWorker
- Determine list of event handlers bound to event
- Debug Target Is Missing?
- User Activity Logging, Telemetry (and Variables in Global Exception Handlers)
- Why can I not edit a method that contains an anonymous method in the debugger?
- How can I write output from a unit test?
- Current possibilities for tracing program flow in C#?
- Attach Debugger to IIS instance
- How can I use DebugBreak() in C#?
- Program and debugger quit without indication of problem
- Can the Visual Studio Debugger display strings unquoted/unescaped?
- LOH fragmentation – 2015 update
- Cannot debug Blazor wasm
- Uniquely Identifying Reference Types in the Debugger
- How to debug class library that called from external app?
- Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away
- Visual Studio: auto attach to a process when the process is spawned
- F5 or Start Debugging Button is Greyed Out for Winform application?
- Programs randomly getting System.AccessViolationException
- Stop Visual Studio from breaking on exception in Tasks