Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3637182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:07:34+00:00 2026-05-19T01:07:34+00:00

AFAIK, usual ASP.NET web site/web application switched on into DEBUG mode when web/app-config setting

  • 0

AFAIK, usual ASP.NET web site/web application switched on into DEBUG mode when web/app-config setting “compilation” has debug=”false”.

But I don’t clearly understand how it works. Let’s consider example:

I have <compilation debug="true" />. I’ve added the following line into “Page_Load” method:

 System.Diagnostics.Debug.WriteLine("Page_Load");

When I launched web-site in ‘debug’ mode (using F5 button) It put me ‘Page_Load’ into output window. Everything is ok so far.

When I change application compilation mode into non-debug:

Will it recompile everything for ‘non-debug’ mode? Is this enough to go into “production” environment with this change only?

I guess, it should be enough for web-site that doesn’t use other project. Otherwise, I would better switch whole configuration into “Release” mode. In this case EACH project will be recompiled in “Release” mode.

Am I right? Could you please point me if something is wrong here?

Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:07:35+00:00Added an answer on May 19, 2026 at 1:07 am

    The point about your question is the difference between compiling in Visual Studio’s Debug/Release modes and the Web.config’s debug flag.

    I’ll try to explain you both.

    First of all, you must get to know how an ASP.NET application is compiled, otherwise you won’t understand the difference between the two compilations.

    An ASP.NET application is made by markup (ie. .aspx pages, .ascx controls, .ashx .asmx marker files) and code-behind. Code-behind, from your IDE’s point of view (no matter Visual Studio, MonoDevelop, etc.) is a .NET Class Library, ie. a set of classes that don’t do anything alone. These can be compiled into Debug or Release mode indifferently by IDE setting. If you compile into Release mode, then calls to Debug class will be ignored.

    What about markup? When you start the web application, the markup files get compiled by the application server to get the final assemblies. For example, a Default.aspx page with a code-behind file is compiled into a final class that inherits the code-behind class and writes to HTTP output all of its static parts, plus all the controls instantiated in the base class in the positions that have been chosen during design. Inline code (ie. <script runat=server> tags) gets compiled too. In order to choose the compilation mode, the debug flag in Web.config is used, because you can’t determine for sure if an assembly has been compiled in debug or release mode by simply reflecting on it (though there could be some empyrical criteria).

    In a few words

    1. When you call Debug class from code-behind, make sure that your IDE compiles the website into Debug mode
    2. When you call Debug class from inline code in markup, make sure you have Web.config’s debug flag set
    3. If you deploy your application as source code (it doesn’t work for me in Mono, I must first xbuild it), I’m unsure but I believe the debug flag will be used for first compilation stage too

    I hope I have been of help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

AFAIK IIS restarts, whenever any of the web.config files is changed. I've created my
AFAIK ado.net datareaders and datasets don't seem to support joins in sql statements. Is
AFAIK, the JQuery ID selector: var ctlId = $('#' + strControlId); gets translated into
AFAIK one of the objectives of Stack Overflow is to make sure anyone can
AFAIK, Currency type in Delphi Win32 depends on the processor floating point precision. Because
AFAIK ROWID in Oracle represents physical location of a record in appropriate datafile. In
AFAIK, memory in Java is based on heap from which the memory is allotted
AFAIK, Hibernate transforms all sql to prepared statement form before issuing it to the
AFAIK SQLite returns unicode objects for TEXT in Python. Is it possible to get
AFAIK, the FastMM ReportMemoryLeaksOnShutdown couldn't detect memory leaks caused by direct Windows API call,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.