Possible Duplicate:
C# if/then directives for debug vs release
I am working on a C# project and I like to know how to add special cases while I am running the program in the debugger in the Debug Mode I have access to certain resources that I would not normally have in the release version.
Here is what keeps happening, I have admin tools built into the program, that are just for debugging, like a button that says test and put what ever code I want to into it. What keeps happening I forget to hide that button and I release it to the clients. I would love to have that test button there only while it's running in the debug mode but not any other time.
This turns on my admin tools
rpg_Admin.Visible = true;
This turns off my admin tools
rpg_Admin.Visible = false;
Is there a simple way to do this?
if Debug Mode
rpg_Admin.Visible = true
or maybe while it's running in visual studio it's
rpg_Admin.Visible = true
but when it's running on it's own
rpg_Admin.Visible = false
I am running on Visual Studio 2010
Thanks.