473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session Stage\Variables

We are in the process of testing a large web project that I converted from
VS 2003 to VS 2005. Everything seems to be working except for a few minor
things. But the main issue I have is this, I have about 5 or 6 developers
testing this web site in a staging environment on a Microsoft 2003 Server
box. We have a base page that gets called on every page and checks for
session variables. After about 20 - 30 minutes these session variables are
getting cleared out and throwing an "object reference not set to an instance
of an object" error, this is due to the session variable all of sudden no
longer exists, This was not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding is it
shouldn't time out for everyone at the same time and should time out if the
session is active.

Leading up to the time the error shows, I get this error in the eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick
Sep 27 '07 #1
14 2243
You set the timeout for 20 minutes and you say it starts throwing errors
after 20 minutes? Uh, isn't that what you would expect?

Also, why aren't you trapping for the existance of the session variable
prior to trying to access it? That has been an issue since for over
6 years now. That's not new in .NET 2.0.

You could also paste this in your global.asax and log the
error.

using System.Diagnost ics;

protected void Application_Err or(object sender, EventArgs e)
{
Exception objErr = Server.GetLastE rror().GetBaseE xception();
string err = "Error Caught in Application_Err or event\n" +
"Error in: " + Request.Url.ToS tring() +
"\nError Message:" + objErr.Message. ToString()+
"\nStack Trace:" + objErr.StackTra ce.ToString();
EventLog.WriteE ntry("Sample_We bApp",err,Event LogEntryType.Er ror);
Server.ClearErr or();
//additional actions...
}

You may have an unhandled error somewhere in the app
that is causing IIS to shutdown the app pool (which will kill
InProc Session) and restart it.

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%******** ********@TK2MSF TNGP02.phx.gbl. ..
We are in the process of testing a large web project that I converted from
VS 2003 to VS 2005. Everything seems to be working except for a few minor
things. But the main issue I have is this, I have about 5 or 6 developers
testing this web site in a staging environment on a Microsoft 2003 Server
box. We have a base page that gets called on every page and checks for
session variables. After about 20 - 30 minutes these session variables are
getting cleared out and throwing an "object reference not set to an
instance of an object" error, this is due to the session variable all of
sudden no longer exists, This was not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding is
it shouldn't time out for everyone at the same time and should time out if
the session is active.

Leading up to the time the error shows, I get this error in the eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick
Sep 27 '07 #2
The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005) is
that if you had a worker thread and it throws unhandled exception then the
whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown but
Session variables are lost and exception (similar to yours) is logged into
NT event log.

So look if you have a worker threads and enclose them into try.. catch...

PS: worker threads are the ones that you created yourself. Normal flow of
ASP.NET pages are normal threads and ASP.NET aware of them and catches all
exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%******** ********@TK2MSF TNGP02.phx.gbl. ..
We are in the process of testing a large web project that I converted from
VS 2003 to VS 2005. Everything seems to be working except for a few minor
things. But the main issue I have is this, I have about 5 or 6 developers
testing this web site in a staging environment on a Microsoft 2003 Server
box. We have a base page that gets called on every page and checks for
session variables. After about 20 - 30 minutes these session variables are
getting cleared out and throwing an "object reference not set to an
instance of an object" error, this is due to the session variable all of
sudden no longer exists, This was not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding is
it shouldn't time out for everyone at the same time and should time out if
the session is active.

Leading up to the time the error shows, I get this error in the eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick

Sep 27 '07 #3
True. One possiblity "might" be Server.Transfer and Response.Redire ct
and not using a return statement right afterwards.

Response.Redire ct("blah.aspx", false);
return;

I've seen this throw exceptions if the return line is missing.

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:uC******** *****@TK2MSFTNG P06.phx.gbl...
The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005) is
that if you had a worker thread and it throws unhandled exception then the
whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown but
Session variables are lost and exception (similar to yours) is logged into
NT event log.

So look if you have a worker threads and enclose them into try.. catch...

PS: worker threads are the ones that you created yourself. Normal flow of
ASP.NET pages are normal threads and ASP.NET aware of them and catches all
exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%******** ********@TK2MSF TNGP02.phx.gbl. ..
>We are in the process of testing a large web project that I converted
from VS 2003 to VS 2005. Everything seems to be working except for a few
minor things. But the main issue I have is this, I have about 5 or 6
developers testing this web site in a staging environment on a Microsoft
2003 Server box. We have a base page that gets called on every page and
checks for session variables. After about 20 - 30 minutes these session
variables are getting cleared out and throwing an "object reference not
set to an instance of an object" error, this is due to the session
variable all of sudden no longer exists, This was not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding is
it shouldn't time out for everyone at the same time and should time out
if the session is active.

Leading up to the time the error shows, I get this error in the eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick

Sep 27 '07 #4
I do not believe that it throws an unhandled exception.
It will not terminate the process.
Might give the user an error message but sessions will be intact.

George.
"Robbe Morris - [MVP] C#" <in**@eggheadca fe.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
True. One possiblity "might" be Server.Transfer and Response.Redire ct
and not using a return statement right afterwards.

Response.Redire ct("blah.aspx", false);
return;

I've seen this throw exceptions if the return line is missing.

--
Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:uC******** *****@TK2MSFTNG P06.phx.gbl...
>The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
is that if you had a worker thread and it throws unhandled exception then
the whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown
but Session variables are lost and exception (similar to yours) is logged
into NT event log.

So look if you have a worker threads and enclose them into try.. catch...

PS: worker threads are the ones that you created yourself. Normal flow of
ASP.NET pages are normal threads and ASP.NET aware of them and catches
all exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%******* *********@TK2MS FTNGP02.phx.gbl ...
>>We are in the process of testing a large web project that I converted
from VS 2003 to VS 2005. Everything seems to be working except for a few
minor things. But the main issue I have is this, I have about 5 or 6
developers testing this web site in a staging environment on a Microsoft
2003 Server box. We have a base page that gets called on every page and
checks for session variables. After about 20 - 30 minutes these session
variables are getting cleared out and throwing an "object reference not
set to an instance of an object" error, this is due to the session
variable all of sudden no longer exists, This was not an issue with
2003.

I have sessionstate enabled and set to timeout at 20. My understanding
is it shouldn't time out for everyone at the same time and should time
out if the session is active.

Leading up to the time the error shows, I get this error in the
eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description :
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick


Sep 27 '07 #5
It throws thread abort exceptions.

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:Ou******** ******@TK2MSFTN GP05.phx.gbl...
>I do not believe that it throws an unhandled exception.
It will not terminate the process.
Might give the user an error message but sessions will be intact.

George.
"Robbe Morris - [MVP] C#" <in**@eggheadca fe.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>True. One possiblity "might" be Server.Transfer and Response.Redire ct
and not using a return statement right afterwards.

Response.Redir ect("blah.aspx" ,false);
return;

I've seen this throw exceptions if the return line is missing.

--
Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:uC******* ******@TK2MSFTN GP06.phx.gbl...
>>The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
is that if you had a worker thread and it throws unhandled exception
then the whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown
but Session variables are lost and exception (similar to yours) is
logged into NT event log.

So look if you have a worker threads and enclose them into try..
catch...

PS: worker threads are the ones that you created yourself. Normal flow
of ASP.NET pages are normal threads and ASP.NET aware of them and
catches all exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%****** **********@TK2M SFTNGP02.phx.gb l...
We are in the process of testing a large web project that I converted
from VS 2003 to VS 2005. Everything seems to be working except for a
few minor things. But the main issue I have is this, I have about 5 or
6 developers testing this web site in a staging environment on a
Microsoft 2003 Server box. We have a base page that gets called on
every page and checks for session variables. After about 20 - 30
minutes these session variables are getting cleared out and throwing an
"object reference not set to an instance of an object" error, this is
due to the session variable all of sudden no longer exists, This was
not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding
is it shouldn't time out for everyone at the same time and should time
out if the session is active.

Leading up to the time the error shows, I get this error in the
eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Descriptio n:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Applicatio n information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick

Sep 27 '07 #6
But it's not unhandled.....
it's catched inside of ASP.NET framework...

am i right? Only unhandled, ie the ones that go without catch, are
dangerous.
George.

"Robbe Morris - [MVP] C#" <in**@eggheadca fe.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
It throws thread abort exceptions.

--
Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:Ou******** ******@TK2MSFTN GP05.phx.gbl...
>>I do not believe that it throws an unhandled exception.
It will not terminate the process.
Might give the user an error message but sessions will be intact.

George.
"Robbe Morris - [MVP] C#" <in**@eggheadca fe.comwrote in message
news:%2******* *********@TK2MS FTNGP05.phx.gbl ...
>>True. One possiblity "might" be Server.Transfer and Response.Redire ct
and not using a return statement right afterwards.

Response.Redi rect("blah.aspx ",false);
return;

I've seen this throw exceptions if the return line is missing.

--
Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:uC****** *******@TK2MSFT NGP06.phx.gbl.. .
The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
is that if you had a worker thread and it throws unhandled exception
then the whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown
but Session variables are lost and exception (similar to yours) is
logged into NT event log.

So look if you have a worker threads and enclose them into try..
catch...

PS: worker threads are the ones that you created yourself. Normal flow
of ASP.NET pages are normal threads and ASP.NET aware of them and
catches all exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%***** ***********@TK2 MSFTNGP02.phx.g bl...
We are in the process of testing a large web project that I converted
from VS 2003 to VS 2005. Everything seems to be working except for a
few minor things. But the main issue I have is this, I have about 5 or
6 developers testing this web site in a staging environment on a
Microsoft 2003 Server box. We have a base page that gets called on
every page and checks for session variables. After about 20 - 30
minutes these session variables are getting cleared out and throwing
an "object reference not set to an instance of an object" error, this
is due to the session variable all of sudden no longer exists, This
was not an issue with 2003.
>
I have sessionstate enabled and set to timeout at 20. My understanding
is it shouldn't time out for everyone at the same time and should time
out if the session is active.
>
Leading up to the time the error shows, I get this error in the
eventlog:
>
Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description :
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0
>
Applicati on information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1
>
Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE
>
Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE
>
Custom event details:
>
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
>
Any suggestions?
>
Thanks in advance!
Rick
>


Sep 27 '07 #7
Thanks for the input!
Here is one thing I discovered with the code(by the way I didn't write this
it was inherted from other developers who are no longer here).
We have a data layer that accepts queries and excecutes them etc ...
Within this data layer the exceptions are handled and logged to the event
log. within the try catch after logging the exception, the code throws a new
exception to bubble up to the calling class, this is were I am getting an
unhandled exception error. So, this worked in 1.1 and bubbled the exception
but now it doesn't in 2.0. What is the correct way to accomplish this?

Sample Code:

Try
runSQL(SQL)
Catch EX as exception
logexceptionfro mDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(Ex ceptionObject )

Throw New Exception("Data LayerName", ExceptionObject )

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:uC******** *****@TK2MSFTNG P06.phx.gbl...
The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005) is
that if you had a worker thread and it throws unhandled exception then the
whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown but
Session variables are lost and exception (similar to yours) is logged into
NT event log.

So look if you have a worker threads and enclose them into try.. catch...

PS: worker threads are the ones that you created yourself. Normal flow of
ASP.NET pages are normal threads and ASP.NET aware of them and catches all
exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%******** ********@TK2MSF TNGP02.phx.gbl. ..
>We are in the process of testing a large web project that I converted
from VS 2003 to VS 2005. Everything seems to be working except for a few
minor things. But the main issue I have is this, I have about 5 or 6
developers testing this web site in a staging environment on a Microsoft
2003 Server box. We have a base page that gets called on every page and
checks for session variables. After about 20 - 30 minutes these session
variables are getting cleared out and throwing an "object reference not
set to an instance of an object" error, this is due to the session
variable all of sudden no longer exists, This was not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding is
it shouldn't time out for everyone at the same time and should time out
if the session is active.

Leading up to the time the error shows, I get this error in the eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick


Sep 27 '07 #8
this is correct approach.
I am not sure why you saying it's not working...... I do not see any obvious
problem....

The only reason I might suggest is that your logexception is throwing some
other error so it actually never makes to your next statement
Throw New Exception("Data LayerName", ExceptionObject )
George.
"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Thanks for the input!
Here is one thing I discovered with the code(by the way I didn't write
this it was inherted from other developers who are no longer here).
We have a data layer that accepts queries and excecutes them etc ...
Within this data layer the exceptions are handled and logged to the event
log. within the try catch after logging the exception, the code throws a
new exception to bubble up to the calling class, this is were I am getting
an unhandled exception error. So, this worked in 1.1 and bubbled the
exception but now it doesn't in 2.0. What is the correct way to accomplish
this?

Sample Code:

Try
runSQL(SQL)
Catch EX as exception
logexceptionfro mDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(Ex ceptionObject )

Throw New Exception("Data LayerName", ExceptionObject )

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:uC******** *****@TK2MSFTNG P06.phx.gbl...
>The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
is that if you had a worker thread and it throws unhandled exception then
the whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown
but Session variables are lost and exception (similar to yours) is logged
into NT event log.

So look if you have a worker threads and enclose them into try.. catch...

PS: worker threads are the ones that you created yourself. Normal flow of
ASP.NET pages are normal threads and ASP.NET aware of them and catches
all exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%******* *********@TK2MS FTNGP02.phx.gbl ...
>>We are in the process of testing a large web project that I converted
from VS 2003 to VS 2005. Everything seems to be working except for a few
minor things. But the main issue I have is this, I have about 5 or 6
developers testing this web site in a staging environment on a Microsoft
2003 Server box. We have a base page that gets called on every page and
checks for session variables. After about 20 - 30 minutes these session
variables are getting cleared out and throwing an "object reference not
set to an instance of an object" error, this is due to the session
variable all of sudden no longer exists, This was not an issue with
2003.

I have sessionstate enabled and set to timeout at 20. My understanding
is it shouldn't time out for everyone at the same time and should time
out if the session is active.

Leading up to the time the error shows, I get this error in the
eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Description :
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick



Sep 27 '07 #9
I walked through the code line by line, It is making it to the next
statement, then as soon as it breaks on the finally it throws an Exception
was unhandled by user code error

"George Ter-Saakov" <gt****@cardone .comwrote in message
news:ux******** ******@TK2MSFTN GP02.phx.gbl...
this is correct approach.
I am not sure why you saying it's not working...... I do not see any
obvious problem....

The only reason I might suggest is that your logexception is throwing some
other error so it actually never makes to your next statement
Throw New Exception("Data LayerName", ExceptionObject )
George.
"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Thanks for the input!
Here is one thing I discovered with the code(by the way I didn't write
this it was inherted from other developers who are no longer here).
We have a data layer that accepts queries and excecutes them etc ...
Within this data layer the exceptions are handled and logged to the event
log. within the try catch after logging the exception, the code throws a
new exception to bubble up to the calling class, this is were I am
getting an unhandled exception error. So, this worked in 1.1 and bubbled
the exception but now it doesn't in 2.0. What is the correct way to
accomplish this?

Sample Code:

Try
runSQL(SQL)
Catch EX as exception
logexceptionfro mDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(Ex ceptionObject )

Throw New Exception("Data LayerName", ExceptionObject )

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone .comwrote in message
news:uC******* ******@TK2MSFTN GP06.phx.gbl...
>>The main difference between .NET 1.1 and .NET 2.0 (VS 2003 and VS 2005)
is that if you had a worker thread and it throws unhandled exception
then the whole process is terminated. It was not the case with .NET 1.1

In IIS environment the process is restarted instead of simple shutdown
but Session variables are lost and exception (similar to yours) is
logged into NT event log.

So look if you have a worker threads and enclose them into try..
catch...

PS: worker threads are the ones that you created yourself. Normal flow
of ASP.NET pages are normal threads and ASP.NET aware of them and
catches all exception thrown for you.
George.

"Rick" <rf*****@newsgr oups.nospamwrot e in message
news:O%****** **********@TK2M SFTNGP02.phx.gb l...
We are in the process of testing a large web project that I converted
from VS 2003 to VS 2005. Everything seems to be working except for a
few minor things. But the main issue I have is this, I have about 5 or
6 developers testing this web site in a staging environment on a
Microsoft 2003 Server box. We have a base page that gets called on
every page and checks for session variables. After about 20 - 30
minutes these session variables are getting cleared out and throwing an
"object reference not set to an instance of an object" error, this is
due to the session variable all of sudden no longer exists, This was
not an issue with 2003.

I have sessionstate enabled and set to timeout at 20. My understanding
is it shouldn't time out for everyone at the same time and should time
out if the session is active.

Leading up to the time the error shows, I get this error in the
eventlog:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 9/27/2007
Time: 1:48:01 PM
User: N/A
Computer: STAGE1
Descriptio n:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/27/2007 1:48:01 PM
Event time (UTC): 9/27/2007 6:48:01 PM
Event ID: e491a210450c499 da175a8f79bda9e 4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Applicatio n information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396 400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\dige centerv2.com\ww w-stage\html\
Machine name: STAGE1

Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWO RK SERVICE

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWO RK SERVICE

Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Any suggestions?

Thanks in advance!
Rick



Sep 27 '07 #10

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

Similar topics

1
7775
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION =...
27
7102
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the...
2
3299
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals and a couple "better pratice" code. Not perfect, but better. Problem : I'm testing everything with Firefox on my machine (IIS on WinXP Pro), and...
13
23294
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 The problem I am having is that each time I reload the same PHP page, I get
30
3958
by: Robert Tweed | last post by:
Does anyone know a good resource discussing the issues involved in session theft? I've read a couple, but none that really address the problem apart from acknowledging that it is a problem; you just don't seem to be able to do much about it. Does anyone have some tried-and-tested measures for preventing session theft, that aren't already...
0
3223
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te documentation it seems it should do it anyway any advice?
14
2359
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and User B has access to 5, now when both of us hits to the server at the same time then their session variables gets mixedup means either User A and...
7
3961
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I got the exact same SessionID as of other users's. Well I guess nothing wrong with my code, do I need to set any property in Web.Config file??
1
2579
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking name of that file from attaching file page to email page through in session file .i am giving a facility of attaching five files to user . and i...
5
2426
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
0
7923
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...
0
7852
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...
1
7974
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...
0
8221
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...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5719
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...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
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
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.