Detect if you're running in a debug or release executable at runtime
问题 I have a library that will be built and published as a nuget package in release mode. However for debugging purposes it is useful to capture stacktraces at various points. Capturing a stack trace is relatively expensive, and I don't want to do it in release. However neither do I want to force everyone to replace my nuget package with the debug version when they want to debug their code. Is there a way to check if the executable that a dll is running in was compiled with debug or release? In