locked
Debug vs Release DLL & web.config RRS feed

  • Question

  • It has come to my attention we have been building & releasing a number of webparts our production in debug mode.

    1. Please could someone state the impact of using debug mode DLL's over release mode DLL's?
    2. More importantly, iss this impact (if any) only significant when debug mode is switched on in the web.config?
    3. If we now start re-releasing webparts using release mode - will this have any significant impact on the environment?

    Further clarification is greatly needed.

    Thanks,

    Kuran

    Friday, May 25, 2012 4:38 PM

Answers

  • Debug code is not optimized by the compiler, so there is always a performance impact (how impactful is a different matter).  Doug is correct in stating that it is performance and security related.  But I disagree as to only using debug code.  FWIW, I always demand that custom solutions use Release mode code prior to going into production.  If there is an issue that requires debugging, then steps are taken to duplicate the issue in a development environment where developers are free to debug their solution.

    http://sharepoint.nauplius.net

    Friday, May 25, 2012 5:24 PM
  • I actually release a lot of my DLL's in debug mode. There is then always the absolute emergency crisis fallback that you can switch on debugging if you absolutely had to. I have never known of any issues with releasing DLLs in debug mode. Theoretically there could be a miniscule security risk and slight degradation in performance. But I have never noticed any difference. To me the emergency fallback outweighs that.

    If you want to switch the DLLs to release mode, there would be no significant impact on the environment, assuming you don't have any special build configurations setup.

    Edit: I was assuming these are internal use dlls, not for public distribution or sale.


    Doug Hemminger http://www.sharepointdoug.com


    Friday, May 25, 2012 4:58 PM

All replies

  • I actually release a lot of my DLL's in debug mode. There is then always the absolute emergency crisis fallback that you can switch on debugging if you absolutely had to. I have never known of any issues with releasing DLLs in debug mode. Theoretically there could be a miniscule security risk and slight degradation in performance. But I have never noticed any difference. To me the emergency fallback outweighs that.

    If you want to switch the DLLs to release mode, there would be no significant impact on the environment, assuming you don't have any special build configurations setup.

    Edit: I was assuming these are internal use dlls, not for public distribution or sale.


    Doug Hemminger http://www.sharepointdoug.com


    Friday, May 25, 2012 4:58 PM
  • Debug code is not optimized by the compiler, so there is always a performance impact (how impactful is a different matter).  Doug is correct in stating that it is performance and security related.  But I disagree as to only using debug code.  FWIW, I always demand that custom solutions use Release mode code prior to going into production.  If there is an issue that requires debugging, then steps are taken to duplicate the issue in a development environment where developers are free to debug their solution.

    http://sharepoint.nauplius.net

    Friday, May 25, 2012 5:24 PM
  • Just a slight clarification. I think it depends on your environment and situation. To clarify our situation, we often develop new (somewhat isolated) projects that get released to production in iterative phases. For us it is handy to have the dlls in debug mode for interim releases until the project is finalized, when we compile in release mode.

    My only point was that compiling in debug mode for production is not the end of the world. The overall impact will be minimal. But I agree that once something is finalized it should be compiled in release mode.


    Doug Hemminger http://www.sharepointdoug.com

    Friday, May 25, 2012 6:33 PM
  • Are there any resources on MSDN or an official site with actual differences and performance metrics. I always build my code in release mode prior to going to production, but now working with a team that does not believe in the real benefits of doing so. I need to build up a case around it.

    Dennis Alzoubi

    Monday, August 13, 2012 10:44 PM