473,769 Members | 5,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'debug' mode and session question

Hi everyone!

1) How can I include 'debug' mode code in my asp.net 2005 project?
i.e. in visual basic 6 (where I come from) the developer could check if the
application was running from within the IDE and
write some code that would run only then.
How can I do that in asp.net 2005?

I've seen an example here:
http://weblogs.asp.net/scottgu/archi...evelopers.aspx
that is checking the user role, but couldn't make it work,
I logon to a domain and can't figure out what role the user is in,
but, besides that, insn't aspnet user the one that logs on?

Tried to check is debug="true" is defined in web.config,
but couldn't figure a way to check this,
how do I check if debug is equal to true or false in web.config?

2) What I would like to do using the above is extend the session to 500
minutes for example,
when developing and let it to 20 minutes for web site visitors.
The above example talks about global.asax code,
but I have session timeout defined in web.config too,
so, which one is loaded first?
web.config or global.asax?
Is it possible to override the session timeout defined in web.config?
And how?
I would like it to never expire,
is it a good idea to set it to 500 minutes or is there a more 'elegant' way
to do that?

Thanks in advance!

Apr 4 '07 #1
4 1625
On 4 Kwi, 22:56, patrickdrd <patrick...@dis cussions.micros oft.com>
wrote:
Hi everyone!

1) How can I include 'debug' mode code in my asp.net 2005 project?
i.e. in visual basic 6 (where I come from) the developer could check if the
application was running from within the IDE and
write some code that would run only then.
How can I do that in asp.net 2005?

I've seen an example here:http://weblogs.asp.net/scottgu/archi...F00_Trick_3A00...
that is checking the user role, but couldn't make it work,
I logon to a domain and can't figure out what role the user is in,
but, besides that, insn't aspnet user the one that logs on?

Tried to check is debug="true" is defined in web.config,
but couldn't figure a way to check this,
how do I check if debug is equal to true or false in web.config?

2) What I would like to do using the above is extend the session to 500
minutes for example,
when developing and let it to 20 minutes for web site visitors.
The above example talks about global.asax code,
but I have session timeout defined in web.config too,
so, which one is loaded first?
web.config or global.asax?
Is it possible to override the session timeout defined in web.config?
And how?
I would like it to never expire,
is it a good idea to set it to 500 minutes or is there a more 'elegant' way
to do that?

Thanks in advance!
Setting session expire to 500 minutes insn't good way to anything :-)
Think about performance.
To check that Debug mode is enabled you can write:

if (HttpContext.Cu rrent.IsDebuggi ngEnabled)
\\ do something you want

Regards
Dariusz Tarczyński

Apr 4 '07 #2
Thank you very much!
So, what could you suggest about session when doing development?
Leave it to 20 minutes both in development and production building?

and...
what about:

so, which one is loaded first?
web.config or global.asax?

"dtarczynsk i" wrote:
Setting session expire to 500 minutes insn't good way to anything :-)
Think about performance.
To check that Debug mode is enabled you can write:

if (HttpContext.Cu rrent.IsDebuggi ngEnabled)
\\ do something you want

Regards
Dariusz Tarczyński
Apr 4 '07 #3
On 4 Kwi, 23:40, patrickdrd <patrick...@dis cussions.micros oft.com>
wrote:
Thank you very much!
So, what could you suggest about session when doing development?
Leave it to 20 minutes both in development and production building?

and...
what about:

so, which one is loaded first?
web.config or global.asax?

"dtarczynsk i" wrote:
Setting session expire to 500 minutes insn't good way to anything :-)
Think about performance.
To check that Debug mode is enabled you can write:
if (HttpContext.Cu rrent.IsDebuggi ngEnabled)
\\ do something you want
Regards
Dariusz Tarczyński
You should leave this value with default 20 mintues in web.config. It
should be enought. If you have longer times (and then more memory
consumption - each session consumes memory) you should thinking about
storing sessions in SesionStateServ er (in database). Thats my opinion.

Regards
Dariusz Tarczynski

Apr 5 '07 #4
On 5 Kwi, 16:28, "dtarczynsk i" <dtarczyn...@gm ail.comwrote:
On 4 Kwi, 23:40, patrickdrd <patrick...@dis cussions.micros oft.com>
wrote:
Thank you very much!
So, what could you suggest about session when doing development?
Leave it to 20 minutes both in development and production building?
and...
what about:
so, which one is loaded first?
web.config or global.asax?
"dtarczynsk i" wrote:
Setting session expire to 500 minutes insn't good way to anything :-)
Think about performance.
To check that Debug mode is enabled you can write:
if (HttpContext.Cu rrent.IsDebuggi ngEnabled)
\\ do something you want
Regards
Dariusz Tarczyński

You should leave this value with default 20 mintues in web.config. It
should be enought. If you have longer times (and then more memory
consumption - each session consumes memory) you should thinking about
storing sessions in SesionStateServ er (in database). Thats my opinion.

Regards
Dariusz Tarczynski
I mean Session StateSterver as special service in server (i wrote in
database - my mistake). Ofcourse StateServer handles sessions in
memory too, that why you should thinking about handling sesions in
database :)

Apr 5 '07 #5

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

Similar topics

6
3855
by: ss | last post by:
Hi I built an exe in console debug mode & Release mode . The console debug mode -exe works fine ...but the release mode EXE starts well but fails mid way . The exe is being started as a service. So I need the Release mode EXE. I've checked the dlls being used . they are working fine for other services.
10
4895
by: Scott | last post by:
I have a simple asp.net app which works fine in debug mode, but crashes on the following line when I run it on the production server: Dim dt As DataTable I have tried the following variations which produce the same result: Dim dt As System.Data.DataTable Dim dt As DataTable = New DataTable The error message reads: System.NullReferenceException: Object reference
8
8420
by: karahan celikel | last post by:
I realized that when SqlServer mode is used for session management Session_End event is not fired in global.asax. What can I do if I want to do something when a user's session end? Thanks
0
1039
by: Daniel Smith | last post by:
Some more information. The reason for the variables being lost is that the Session_Start event is being called several times and this then clears the variables but not the Session Id. The project is an existing project and because the session object and the Context object is used in many different places it isn't realistic to alter this for the sake of getting the project to work well in debug mode.
8
1923
by: | last post by:
I'm starting up the development server myself and using the "Startup Url" property of the web project. The problem is i cannot debug. The debug symbols are never loaded. I realize they are under the temporary internet files folder but I have even tried using the new depoloyment addin-in but that does not seem to work either. There is a /bin folder with the debug symboles in there but it still does not load them up How can i include the...
22
4040
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to receive 5 bytes buffer , I call the BeginReceive and then wait on AsyncWaitHandle.WaitOne() but it is signald imidiatly , and the next call to EndReceive return zero bytes length , also the buffer is empty. here is the code: public static byte...
7
3062
by: =?Utf-8?B?R3JpZ3M=?= | last post by:
Hello, After getting some posts on forums.microsoft.com but no solution I was asked to post over here. Hopefully someone here can help with my problem. I have a Windows Forms application written in C# via VS 2003. It does 100% of what it should while in Debug mode (running in the debugger as well as running the .exe from File Explorer.) However, there is one thing it does not do when compiled in Release mode (running in the debugger...
1
1718
by: gfergo | last post by:
Good Morning, I seem to be having a problem. I thought I could display detailed debugging information (including file name and line number) on a page using two different methods: 1.) modify the debug attribute of the compilation element in the web.config file -
3
3380
by: =?Utf-8?B?bG10dGFn?= | last post by:
We have developed a number of different applications (ASP.NET web site, Windows services, DLLs, Windows forms, etc.) in C# 2.0. We have developed and unit tested all these applications/components using Debug mode. Now we are ready to compile everything for release to production. However, we don’t know whether we should compile all the applications/components/assemblies using Release mode (or keep everything in Debug mode). We’ve...
0
9589
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, 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...
0
9423
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,...
0
10045
jinu1996
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...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7409
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 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...
0
6673
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();...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
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 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.