Hello,
I am using VSNet 2003 and I am trying to programmaticall y detect if debug
attribute in the compilation tag is true or false. How can I do this ?
Thanks,
Jazz 7 4284
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 programmaticall y 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=tru e;
#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 programmaticall y detect if debug attribute in the compilation tag is true or false. How can I do this ? Thanks, Jazz
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 programmaticall y detect if debug attribute in the compilation tag is true or false. How can I do this ? Thanks, Jazz
Jazz,
Prove it to yourself! Shouldn't take more than a minute to
Response.Write( IsDebug.ToStrin g()) 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 programmaticall y detect if debug attribute in the compilation tag is true or false. How can I do this ? 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.
"Peter Bromberg [C# MVP]" wrote: Jazz, Prove it to yourself! Shouldn't take more than a minute to Response.Write( IsDebug.ToStrin g()) 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 programmaticall y detect if debug > attribute in the compilation tag is true or false. How can I do this ? > Thanks, > Jazz
web.config --file
<appSettings>
<add key="debug_flag " value="true" />
</appSettings>
string debug_flag=
System.Configur ation.Configura tionSettings.Ap pSettings["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.ToStrin g()) 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 programmaticall y detect if debug > > attribute in the compilation tag is true or false. How can I do this ? > > Thanks, > > Jazz
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.Configur ation.Configura tionSettings.Ap pSettings["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.ToStrin g()) 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 programmaticall y detect if debug > > > attribute in the compilation tag is true or false. How can I do this ? > > > Thanks, > > > Jazz This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 "<dllname>.dll.config" with
no luck. Every time I try to read from the config file I get the following
error:
"The key 'systemName' does not exist in the appSettings configuration
section."
where "systemName" is the first setting in the...
|
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 an example of what I'm trying to achieve:
I tried a test by creating a simple app Test.exe that has some basic
settings made available to it in the runtime file Test.exe.config.
|
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 version="1.0" encoding="utf-8" ?>
<configuration>
|
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;
Anybody able to give me idea how-to read by C# element which I add to the
machine.config into the new single section?
|
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 setting). Do I
have to resort to using straight XML reading or is there some other way to
access standard config settings?
Thanks in advance.
-Mark
| |
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 set to an instance of an object." message
I thought this may have been to do with Virtual Directory settings but I've
got the folder set as an application in IIS and asp.net is installed and
working. My web.config file is Not Marked read-only and...
|
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" and value is "monkey". I've tried the following ways to retrieve the value and only one works:
//Returns null
Configuration config = ConfigurationManager.OpenExeConfiguration(Assembly.GetEntryAssembly().Location);
string monkey =...
|
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 read the value of redirect from the error statusCode 404. My
web.config looks like this:
<customErrors mode="RemoteOnly" defaultRedirect="Error.aspx">
<error statusCode="404" redirect="Error404.aspx" />
</customErrors>
|
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 expected this config file (.dll.config) to get put
in my web app's bin folder along with it's .dll file when i did a build, and
that didnt' happen either.
do I have access to the app.config in my project or is it worthless? If so
why can i add...
|
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 setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.
This is all well and good....
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |