I have an ASP.NET web application and I have some code that I want to execute only in the debug version. How to do this?
See Question&Answers more detail:osI have an ASP.NET web application and I have some code that I want to execute only in the debug version. How to do this?
See Question&Answers more detail:os#if DEBUG
your code
#endif
You could also add ConditionalAttribute to method that is to be executed only when you build it in debug mode:
[Conditional("DEBUG")]
void SomeMethod()
{
}