{"id":1103,"date":"2005-08-01T02:21:00","date_gmt":"2005-08-01T07:21:00","guid":{"rendered":"http:\/\/blogs.devhorizon.com\/reza\/?p=1103"},"modified":"2005-08-01T02:21:00","modified_gmt":"2005-08-01T07:21:00","slug":"why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production","status":"publish","type":"post","link":"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/","title":{"rendered":"Why do I set Debug=False in my ASP.NET Applications when they go live in production?"},"content":{"rendered":"<p><P class=MsoNormal style=\"MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in\">A web.config of an ASP.NET application has a compilation&nbsp;element which exposes a Debug attribute that can be set to either&nbsp;&#8220;True&#8221; to produce release(retail) binaries or &#8220;False&#8221; for debug binaries.In both cases what is ultimately generated is binary ,but the way they are generated and the way they affect general performance of your ASP.NET application is very different.<\/P><br \/>\n<OL type=1><br \/>\n<LI class=MsoNormal style=\"MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in\">In most of the cases I don&#8217;t really need each page of my ASP.NET application to be compiled <STRONG><U>individually into separate assemblies (Debug=&#8221;True&#8221;).<\/U><\/STRONG> I&nbsp;know the cost of loading each assembly into memory and how it kills the performance. I would even delete global.asax for small ASP.NET applications where I don&#8217;t use it at all as it is also compiled into a separate assembly. <?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:office:office\" \/><o:p><\/o:p><br \/>\n<LI class=MsoNormal style=\"MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in\">I do really need the pages under each folder to be batch-compiled by arriving of the first request rather than multiple compilations upon requests to different pages. Be informed that batch compilation occurs at the directory level, not the application level and there is no batch-compilation when Debug=&#8221;True&#8221;.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in\">Many people bring up some lame excuses that our web server is behind the firewall and who cares about the security!!!! Well, that\u2019s ludicrous that people never think about the problem ahead till they are in trouble. I\u2019d say driving a hummer doesn\u2019t mean that you shouldn&#8217;t buckle up, Firewall is cool but it doesn\u2019t mean that you as a developer should forget about the security principles that you must consider in the project&#8217;s life cycle. When Debug=&#8221;True&#8221; is specified&nbsp;debug symbol file, compiler command line file, compiler output file, etc are all compiled&nbsp;and placed in the <SPAN style=\"FONT-FAMILY: 'Courier New'\">&#8220;WindowsMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET&#8221;&nbsp;<\/SPAN>in addition to the assembly. It means your source code is deployed to the production server and can easily be deciphered.Beside that the inclusion of <SPAN class=highlight1>debug<\/SPAN> information ALSO reduces performance. (but allows a <SPAN class=highlight1>debug<\/SPAN>ger to be attached to step through the assembly&#8217;s code, and also allows ASP.NET to provide additional information when an exception is thrown such as the line on which the exception was thrown)<\/LI><\/OL><br \/>\n<P><A href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpguide\/html\/cpcondevelopinghigh-performanceaspnetapplications.asp\">Microsoft <\/A>offers an excellent&nbsp;whitepaper which I really suggest you to read before deploying your application to the production server.<o:p><\/o:p><\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\"><o:p>&nbsp;<\/o:p><\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A web.config of an ASP.NET application has a compilation&nbsp;element which exposes a Debug attribute that can be set to either&nbsp;&#8220;True&#8221; to produce release(retail) binaries or &#8220;False&#8221; for debug binaries.In both cases what is ultimately generated is binary ,but the way they are generated and the way they affect general performance of your ASP.NET application is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1103","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Why do I set Debug=False in my ASP.NET Applications when they go live in production? - Reza Alirezaei&#039;s Blog %<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reza Alirezaei\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2005\\\/08\\\/01\\\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2005\\\/08\\\/01\\\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\\\/\"},\"author\":{\"name\":\"Reza Alirezaei\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"headline\":\"Why do I set Debug=False in my ASP.NET Applications when they go live in production?\",\"datePublished\":\"2005-08-01T07:21:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2005\\\/08\\\/01\\\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\\\/\"},\"wordCount\":407,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2005\\\/08\\\/01\\\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2005\\\/08\\\/01\\\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\\\/\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2005\\\/08\\\/01\\\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\\\/\",\"name\":\"Why do I set Debug=False in my ASP.NET Applications when they go live in production? - Reza Alirezaei's Blog %\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\"},\"datePublished\":\"2005-08-01T07:21:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2005\\\/08\\\/01\\\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/\",\"name\":\"Reza Alirezaei's Blog\",\"description\":\"Blogging from the field!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\",\"name\":\"Reza Alirezaei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"caption\":\"Reza Alirezaei\"},\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/author\\\/rezaa\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Why do I set Debug=False in my ASP.NET Applications when they go live in production? - Reza Alirezaei's Blog %","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/","twitter_misc":{"Written by":"Reza Alirezaei","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/#article","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/"},"author":{"name":"Reza Alirezaei","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"headline":"Why do I set Debug=False in my ASP.NET Applications when they go live in production?","datePublished":"2005-08-01T07:21:00+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/"},"wordCount":407,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/","url":"https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/","name":"Why do I set Debug=False in my ASP.NET Applications when they go live in production? - Reza Alirezaei's Blog %","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#website"},"datePublished":"2005-08-01T07:21:00+00:00","author":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.devhorizon.com\/reza\/2005\/08\/01\/why-do-i-set-debugfalse-in-my-aspnet-applications-when-they-go-live-in-production\/"]}]},{"@type":"WebSite","@id":"https:\/\/blogs.devhorizon.com\/reza\/#website","url":"https:\/\/blogs.devhorizon.com\/reza\/","name":"Reza Alirezaei's Blog","description":"Blogging from the field!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.devhorizon.com\/reza\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938","name":"Reza Alirezaei","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","caption":"Reza Alirezaei"},"url":"https:\/\/blogs.devhorizon.com\/reza\/author\/rezaa\/"}]}},"_links":{"self":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/comments?post=1103"}],"version-history":[{"count":0,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1103\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/media?parent=1103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/categories?post=1103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/tags?post=1103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}