I have some code that access an API out on the web. One of the API\'s parameters allows me to let them know that I am testing.
I would like to only set this parameter in
I had this same problem and the solution I went with is using:
if (System.Diagnostics.Debugger.IsAttached) { // Code here }
This means that technically in production you can attach a debugger and get that piece of code to run.