471,318 Members | 3,223 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

How to read Config setting

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
Jan 6 '06 #1
7 4157
Sorry, that should have been:
#if (DEBUG)
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:
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

Jan 6 '06 #2
private bool IsDebugMode =false

#if (!DEBUG)
IsDebugMode=true;
#endif

--------------------
Cheers!
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:
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

Jan 6 '06 #3
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

"Peter Bromberg [C# MVP]" wrote:
Sorry, that should have been:
#if (DEBUG)
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:
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

Jan 6 '06 #4
Jazz,
Prove it to yourself! Shouldn't take more than a minute to
Response.Write(IsDebug.ToString()) based on the setting in web.config.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:
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

"Peter Bromberg [C# MVP]" wrote:
Sorry, that should have been:
#if (DEBUG)
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:
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

Jan 6 '06 #5
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.

"Peter Bromberg [C# MVP]" wrote:
Jazz,
Prove it to yourself! Shouldn't take more than a minute to
Response.Write(IsDebug.ToString()) based on the setting in web.config.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:
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

"Peter Bromberg [C# MVP]" wrote:
Sorry, that should have been:
#if (DEBUG)
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:

> 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

Jan 6 '06 #6
web.config --file

<appSettings>
<add key="debug_flag" value="true" />
</appSettings>
string debug_flag=
System.Configuration.ConfigurationSettings.AppSett ings["debug_flag"];

"Jazz" wrote:
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.

"Peter Bromberg [C# MVP]" wrote:
Jazz,
Prove it to yourself! Shouldn't take more than a minute to
Response.Write(IsDebug.ToString()) based on the setting in web.config.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:
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

"Peter Bromberg [C# MVP]" wrote:

> Sorry, that should have been:
> #if (DEBUG)
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Jazz" wrote:
>
> > 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

Jan 7 '06 #7
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" wrote:
web.config --file

<appSettings>
<add key="debug_flag" value="true" />
</appSettings>
string debug_flag=
System.Configuration.ConfigurationSettings.AppSett ings["debug_flag"];

"Jazz" wrote:
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.

"Peter Bromberg [C# MVP]" wrote:
Jazz,
Prove it to yourself! Shouldn't take more than a minute to
Response.Write(IsDebug.ToString()) based on the setting in web.config.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jazz" wrote:

> 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
>
> "Peter Bromberg [C# MVP]" wrote:
>
> > Sorry, that should have been:
> > #if (DEBUG)
> > --
> > Co-founder, Eggheadcafe.com developer portal:
> > http://www.eggheadcafe.com
> > UnBlog:
> > http://petesbloggerama.blogspot.com
> >
> >
> >
> >
> > "Jazz" wrote:
> >
> > > 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

Jan 11 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Scott Graupmann | last post: by
1 post views Thread by MrXs | last post: by
1 post views Thread by vkrasner | last post: by
4 posts views Thread by Chris V | last post: by
9 posts views Thread by =?Utf-8?B?TWlrZQ==?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.