473,388 Members | 1,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 4244
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Scott Graupmann | last post by:
I'm having trouble getting the settings out of my app.config file in a c# project. I have put the file in the root of the project and in the bin output directory with the name "app.config" and...
3
by: Danny | last post by:
Hello, I was wondering if anyone knew if it was possible to make changes to an application's App.config file at runtime and then be able to access those changes immediately. The following is...
1
by: MrXs | last post by:
i have a setting form for my program and wish to allow the setting to be saved and reopened to the last set setting on program startup.. lets say i have a xml file like this : <?xml...
1
by: vkrasner | last post by:
It works with VS2003 and does not in VS2005: in VS2003 : string sMyvalue = ConfigurationSettings.AppSettings; in VS2005 (does not work!!) string sMyvalue = ConfigurationManager.AppSettings; ...
2
by: Mark Friedman | last post by:
I've seen lots of documentation on how to create and read custom configuration settings but I'm interested in reading a standard setting (i.e. the loginUrl attribute of the authentication/forms...
4
by: Chris V | last post by:
I'm having a problem deploying my ASP.NET application to a WIN2k server. (IIS5 .NET 1.1) When I try to access ConfigurationSettings.AppSettings("WhateverValue") I get an "Object reference not...
5
by: Keith | last post by:
Hello all, I have a C# Windows Forms app. It is in namespace App.GUI. It builds to Nav.exe. I have entered an application level setting using the designer. Its type is string, name is "FOO"...
9
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. Is it programatically possible in VB.NET to read the contents of web.config's <customErrorselement? I looked at using ConfigurationSettings.AppSettings, but that doesn't work. I need to...
6
by: TS | last post by:
I cannot get this to work. I added an app.config to a project i reference from my web application project (vs 05) but can see no way to access the settings within it. the other thing is that I...
5
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.