473,503 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

doubt

In C-sharp, I wnat to know whether the Component is compiled in Debug Mode
or Run Mode through Code. How is it possible?
Is there any way to Access the Config file and check? Please let me know
with example
Nov 15 '05 #1
6 3280
The Debug/Release mode is just a name, you can call them Jon/Bob it doesn
matter. What matter is the configuration underneath it. Check the
configuration manager to find out.

To answer your question, yes you can by default if you didn't change any the
configuration settings. Example:

#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif
HTH,
/m

PS: please start a new thread and change the subject line! It's really
annoying.

"Baskar RajaSekharan" <rb*@srasys.co.in> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
In C-sharp, I wnat to know whether the Component is compiled in Debug Mode or Run Mode through Code. How is it possible?
Is there any way to Access the Config file and check? Please let me know
with example

Nov 15 '05 #2
Thank you for your reply. How to check the Configuration Manager through
code and findout it's debug or Release. Can you give
me some sample code?

"Muscha" <mu****@no.spam.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
The Debug/Release mode is just a name, you can call them Jon/Bob it doesn
matter. What matter is the configuration underneath it. Check the
configuration manager to find out.

To answer your question, yes you can by default if you didn't change any the configuration settings. Example:

#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif
HTH,
/m

PS: please start a new thread and change the subject line! It's really
annoying.

"Baskar RajaSekharan" <rb*@srasys.co.in> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
In C-sharp, I wnat to know whether the Component is compiled in Debug

Mode
or Run Mode through Code. How is it possible?
Is there any way to Access the Config file and check? Please let me know with example


Nov 15 '05 #3
> Thank you for your reply. How to check the Configuration Manager through
code and findout it's debug or Release. Can you give
me some sample code?
#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif

Configuration Manager -> Open Visual Studio, right click on the project
file, Properties.

/m

"Muscha" <mu****@no.spam.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
The Debug/Release mode is just a name, you can call them Jon/Bob it doesn
matter. What matter is the configuration underneath it. Check the
configuration manager to find out.

To answer your question, yes you can by default if you didn't change any

the
configuration settings. Example:

#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif
HTH,
/m

PS: please start a new thread and change the subject line! It's really
annoying.

"Baskar RajaSekharan" <rb*@srasys.co.in> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
In C-sharp, I wnat to know whether the Component is compiled in
Debug Mode
or Run Mode through Code. How is it possible?
Is there any way to Access the Config file and check? Please let me

know with example



Nov 15 '05 #4
How to do that in Run Time? I hope you are not properly understand My
Qustion. If repeat the Qustion.

In C-Sharp I create two Component and compiled one in Release Mode and
another one is in compile Mode. Assume that the two components are

A.dll = Debug Mode

B.dll = RelatesMode

I want to write one method which will accept the dll path as a input and
return it's compiled in Debug mode or release mode. based on the Result i am
going to do some operations.

How the above one is possible. Can you give me some sample code.

Regards,
R.Baskar

"Muscha" <mu****@no.spam.net> wrote in message
news:uv**************@tk2msftngp13.phx.gbl...
Thank you for your reply. How to check the Configuration Manager through
code and findout it's debug or Release. Can you give
me some sample code?


#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif

Configuration Manager -> Open Visual Studio, right click on the project
file, Properties.

/m

"Muscha" <mu****@no.spam.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
The Debug/Release mode is just a name, you can call them Jon/Bob it doesn matter. What matter is the configuration underneath it. Check the
configuration manager to find out.

To answer your question, yes you can by default if you didn't change
any the
configuration settings. Example:

#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif
HTH,
/m

PS: please start a new thread and change the subject line! It's really
annoying.

"Baskar RajaSekharan" <rb*@srasys.co.in> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> In C-sharp, I wnat to know whether the Component is compiled in Debug Mode
> or Run Mode through Code. How is it possible?
> Is there any way to Access the Config file and check? Please let

me know
> with example
>
>



Nov 15 '05 #5
I see, now I get your question.

In that case I am not sure about how that can be done. Maybe someone else
can shed some light? Compiling a compoenent in debug or release mode will
put a TRACE/DEBUG in the /define command line parameter to the compiler.

Maybe if you look at this it may give you some information.

/m
"Baskar RajaSekharan" <rb*@srasys.co.in> wrote in message
news:uM**************@tk2msftngp13.phx.gbl...
How to do that in Run Time? I hope you are not properly understand My
Qustion. If repeat the Qustion.

In C-Sharp I create two Component and compiled one in Release Mode and
another one is in compile Mode. Assume that the two components are

A.dll = Debug Mode

B.dll = RelatesMode

I want to write one method which will accept the dll path as a input and
return it's compiled in Debug mode or release mode. based on the Result i am going to do some operations.

How the above one is possible. Can you give me some sample code.

Regards,
R.Baskar

"Muscha" <mu****@no.spam.net> wrote in message
news:uv**************@tk2msftngp13.phx.gbl...
Thank you for your reply. How to check the Configuration Manager through code and findout it's debug or Release. Can you give
me some sample code?


#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif

Configuration Manager -> Open Visual Studio, right click on the project
file, Properties.

/m

"Muscha" <mu****@no.spam.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
> The Debug/Release mode is just a name, you can call them Jon/Bob it

doesn
> matter. What matter is the configuration underneath it. Check the
> configuration manager to find out.
>
> To answer your question, yes you can by default if you didn't change any the
> configuration settings. Example:
>
> #if (DEBUG)
> Console.WriteLine("Debug mode");
> #elif (TRACE)
> Console.WriteLine("Release mode");
> #endif
>
>
> HTH,
> /m
>
> PS: please start a new thread and change the subject line! It's really > annoying.
>
> "Baskar RajaSekharan" <rb*@srasys.co.in> wrote in message
> news:%2****************@tk2msftngp13.phx.gbl...
> > In C-sharp, I wnat to know whether the Component is compiled in

Debug
> Mode
> > or Run Mode through Code. How is it possible?
> > Is there any way to Access the Config file and check? Please let me know
> > with example
> >
> >
>
>



Nov 15 '05 #6
If you are writing some non-shipping app and doing this as part of some
internal work then try this...

With CLR 1.0, the debug assemblies have a custom attribute
System.Diagnostics.DebuggableAttribute. The release assemblies do not have
this attribute. The attribute is a runtime JIT directive. This is a very
unreliable solution because some body writing a release dll could put this
attribute on the assembly as well. The attribute is added to the debug
assembly only if the assembly was built with some compiler options. And
that is why I insist that you wouldn't want to ship your work with this
solution.
If you have a later version of the CLR then find where ildasm.exe is on
your machine. Run it on the dll. Look at the assembly manifest of a debug
and release dlls. See what you find different. The new versions have
replaced the System.Diagnositics.Debuggable with
System.Runtime.CompilerServices.
Again, I repeat, this is not a solid solution. But if you are working on
some internal tool and need a quick and dirty solution it might help.

--------------------
Reply-To: "Baskar RajaSekharan" <rb*@srasys.co.in>
From: "Baskar RajaSekharan" <rb*@srasys.co.in>
References: <#B**************@tk2msftngp13.phx.gbl> <Oe**************@TK2MSFTNGP09.phx.gbl>
<ux**************@TK2MSFTNGP12.phx.gbl>
<uv**************@tk2msftngp13.phx.gbl>Subject: Re: Checking compile mode (Was: doubt)
Date: Wed, 5 Nov 2003 14:30:39 +0530
Lines: 85
Organization: SRA System Ltd
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <uM**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: 203.199.194.34
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:196847
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

How to do that in Run Time? I hope you are not properly understand My
Qustion. If repeat the Qustion.

In C-Sharp I create two Component and compiled one in Release Mode and
another one is in compile Mode. Assume that the two components are

A.dll = Debug Mode

B.dll = RelatesMode

I want to write one method which will accept the dll path as a input and
return it's compiled in Debug mode or release mode. based on the Result i amgoing to do some operations.

How the above one is possible. Can you give me some sample code.

Regards,
R.Baskar

"Muscha" <mu****@no.spam.net> wrote in message
news:uv**************@tk2msftngp13.phx.gbl...
> Thank you for your reply. How to check the Configuration Managerthrough > code and findout it's debug or Release. Can you give
> me some sample code?


#if (DEBUG)
Console.WriteLine("Debug mode");
#elif (TRACE)
Console.WriteLine("Release mode");
#endif

Configuration Manager -> Open Visual Studio, right click on the project
file, Properties.

/m
>
> "Muscha" <mu****@no.spam.net> wrote in message
> news:Oe**************@TK2MSFTNGP09.phx.gbl...
> > The Debug/Release mode is just a name, you can call them Jon/Bob it

doesn
> > matter. What matter is the configuration underneath it. Check the
> > configuration manager to find out.
> >
> > To answer your question, yes you can by default if you didn't changeany > the
> > configuration settings. Example:
> >
> > #if (DEBUG)
> > Console.WriteLine("Debug mode");
> > #elif (TRACE)
> > Console.WriteLine("Release mode");
> > #endif
> >
> >
> > HTH,
> > /m
> >
> > PS: please start a new thread and change the subject line! It's really > > annoying.
> >
> > "Baskar RajaSekharan" <rb*@srasys.co.in> wrote in message
> > news:%2****************@tk2msftngp13.phx.gbl...
> > > In C-sharp, I wnat to know whether the Component is compiled in

Debug
> > Mode
> > > or Run Mode through Code. How is it possible?
> > > Is there any way to Access the Config file and check? Please letme > know
> > > with example
> > >
> > >
> >
> >
>
>



Rakesh, EFT.

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1986
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the...
138
5104
by: ambika | last post by:
Hello, Am not very good with pointers in C,but I have a small doubt about the way these pointers work.. We all know that in an array say x,x is gonna point to the first element in that...
4
2680
by: dam_fool_2003 | last post by:
I am just a beginner in tree data – struct. I have this little doubt. Left node ‘weights' lesser than the right one. I have seen, so far it is algorithm implementations. But why not vice-versa that...
20
1626
by: maadhuu | last post by:
firstly, i am thankful to all those who answered the 1st set of doubts. And i am not yet enlightened to that extent , coz ' i keep getting doubts. is the following defined in the language ?? int...
3
1317
by: SMG | last post by:
Hi All, It might be a silly doubt, but it is a doubt.... I am using form authentication for my website, now my web application is gonna be deployed on two web servers with Load Balancing...
77
3614
by: muttaa | last post by:
Hello all, My doubt is going to be so primitive that i ask you all to forgive me beforehand.... Here's the code snippet: int main() { int x=5;
11
2084
by: Bob Nelson | last post by:
I don't remember seeing the term ``doubt'' used much in c.l.c. back in the 90's. When did this word become nearly synonymous with ``question'' or ``query'' and does it have static duration?
122
4158
by: ivan | last post by:
hi all, if I have: if(A && B || C) which operation gets executed first? If I remeber well should be &&, am I correct? thanks
5
1700
by: Paulo | last post by:
Hi, I have a RadioButtonList and I need to do some verifications on a "OnChange" event on client... because on classic asp/html I just add a "onChange" event on <input type="radio" onChange="">,...
0
7204
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
7091
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
7282
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,...
0
7464
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5018
isladogs
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...
0
4680
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...
0
1516
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 ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
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...

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.