We help IT Professionals succeed at work.

ASP.NET dll compilation in debug or Release Mode

Hello,

As I know there is two way in ASP.NET for dll deployment of production servers:

1. Compile  the code in Release Mode, in this way, dll will be lighter, without debug symbol, and this way code execution will be much faster.
2. compile the code as normal, in debug mode. and set the web.config node "debug Mode=false".

My Questions is:
What is difference between Compiling the code in *only* Release Mode or *only* setting the web.config node.

Please suggest.
Comment
Watch Question

Author

Commented:
Its ok,what about compiling the code in debug mode and setting compilation debug="false" in web.config?
you cannot do that.
Debugging will not will available if debug is set to false in config file

Author

Commented:
I know debugging will not be available. But what about the performance, if we put debug mode compiled dll and set web config compilation debug mode="false".
you can do that, But performance will not be as good as DLL's of release mode
nice article

Don’t run production ASP.NET Applications with debug=”true” enabled
http://weblogs.asp.net/scottgu/archive/2006/04/11/442448.aspx

Author

Commented:
Its Ok.

But Please consider a special case:

we have a dll compiled in debug mode, going to deploy it on production with setting debug="false" on server.

Is it acceptable or not? what will be impact on performance.

Author

Commented:
How can I get exact Error line number, when any error occur in ASP.NET code?

Remember: I have release mode compiled dll and in web.config, debug mode is set to false.
if you put try catch, it will catch the exception and will also display the line number.
Only difference is that, dubugger will not be called.

Author

Commented:
whatever I got the answer, it was the best from all of them.