views:

60

answers:

4

hi all!

how can i tell the diffence between a website that has been published in release mode and the same website that was published in debug mode?

thank you

A: 

if it were published in debug mode with debug=true in the web.config then there would be a little bit of a performance hit. also if you can access the server then debug mode may mean the presence of .pdb files

apart from that i am not sure you can

PaulStack
in both cases when i publish both in release and debug i have pdb files from other projects in my solution... that are refrenced from the website.
guy schaller
+3  A: 

As I understand your question, you want to check programatically if the Website is running in debug mode. If this is really your question, then you may have a look at this Blog post from Rick Strahl.

Don't forget to read the comments, as there are other solutions.

Rick's solution:

bool isInDebugMode = HttpContext.Current.IsDebuggingEnabled
Dave
+2  A: 

You can tell from ILDASM if an assembly is debug or release build.

http://msmvps.com/blogs/bill/archive/2004/06/17/8339.aspx

Sachin Shanbhag
A: 

You can use C# Preprocessor Directives: #IF DEBUG

#if DEBUG 
//Put code in here to show it's in debug mode.
//like.....
DebugMessageLabel.Visible = true;
#endif

http://msdn.microsoft.com/en-us/library/4y6tbswk.aspx

Ryan Ternier