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
In addition to #if #endif directives, you can also use conditional attributes. If you mark a method with the attribute
[Conditional("Debug")]
It will only be compiled and run when your application is built in debug mode. As was noted in the comment below, these only work when the method has a void return type.