How to read Config setting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am using VSNet 2003 and I am trying to programmatically detect if debug
attribute in the compilation tag is true or false. How can I do this ?
Thanks,
Jazz
 
private bool IsDebugMode =false

#if (!DEBUG)
IsDebugMode=true;
#endif
 
Peter,
I may miss one thing. The debug attribute I am talking about is the one in
the compilation tag in the web.config file, and I am doing asp.net stuff.
Will #if (DEBUG) still work?
I tried and it seems it doesn't work.
Thanks,
Jazz
 
Answer is NO. I think DEBUG value depends on whether the code is built in
Debug mode or release mode and it has nothing to do with the one in
web.config.
 
web.config --file

<appSettings>
<add key="debug_flag" value="true" />
</appSettings>


string debug_flag=
System.Configuration.ConfigurationSettings.AppSettings["debug_flag"];
 
I know we can use appsettings. But what I really want is to utilize the
existing debug attribute value in the compilation tag in the web.config file.
<Compilation debug=true/>

scottJ said:
web.config --file

<appSettings>
<add key="debug_flag" value="true" />
</appSettings>


string debug_flag=
System.Configuration.ConfigurationSettings.AppSettings["debug_flag"];

Jazz said:
Answer is NO. I think DEBUG value depends on whether the code is built in
Debug mode or release mode and it has nothing to do with the one in
web.config.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top