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 other words even though my nuget package was compiled with release, I want to run different code depending on whether or not the executable that my library is used by was built in release or debug?