By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,422 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,422 IT Pros & Developers. It's quick & easy.

Session Stage\Variables

P: n/a
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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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
Share this Question
Share on Google+
14 Replies


P: n/a
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.Diagnostics;

protected void Application_Error(object sender, EventArgs e)
{
Exception objErr = Server.GetLastError().GetBaseException();
string err = "Error Caught in Application_Error event\n" +
"Error in: " + Request.Url.ToString() +
"\nError Message:" + objErr.Message.ToString()+
"\nStack Trace:" + objErr.StackTrace.ToString();
EventLog.WriteEntry("Sample_WebApp",err,EventLogEn tryType.Error);
Server.ClearError();
//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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
True. One possiblity "might" be Server.Transfer and Response.Redirect
and not using a return statement right afterwards.

Response.Redirect("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*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
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**@eggheadcafe.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
True. One possiblity "might" be Server.Transfer and Response.Redirect
and not using a return statement right afterwards.

Response.Redirect("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*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
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**************@TK2MSFTNGP05.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**@eggheadcafe.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>True. One possiblity "might" be Server.Transfer and Response.Redirect
and not using a return statement right afterwards.

Response.Redirect("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*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
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**@eggheadcafe.comwrote in message
news:%2****************@TK2MSFTNGP05.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**************@TK2MSFTNGP05.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**@eggheadcafe.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>>True. One possiblity "might" be Server.Transfer and Response.Redirect
and not using a return statement right afterwards.

Response.Redirect("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*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0
>
Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1
>
Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
>
Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
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
logexceptionfromDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(ExceptionObject )

Throw New Exception("DataLayerName", ExceptionObject)

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone.comwrote in message
news:uC*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
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("DataLayerName", ExceptionObject)
George.
"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP03.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
logexceptionfromDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(ExceptionObject )

Throw New Exception("DataLayerName", ExceptionObject)

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone.comwrote in message
news:uC*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
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**************@TK2MSFTNGP02.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("DataLayerName", ExceptionObject)
George.
"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP03.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
logexceptionfromDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(ExceptionObject )

Throw New Exception("DataLayerName", ExceptionObject)

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone.comwrote in message
news:uC*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1

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

Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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

P: n/a
Is it actually logging a database error anywhere?

You might want to put a line to exit out of the database
error logging method prior to it performing any action.

It would be interesting to see if something funny
is going on down there....

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


"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>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**************@TK2MSFTNGP02.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("DataLayerName", ExceptionObject)
George.
"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP03.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
logexceptionfromDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(ExceptionObject )

Throw New Exception("DataLayerName", ExceptionObject)

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone.comwrote in message
news:uC*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
Event sequence: 1342
Event occurrence: 6
Event detail code: 0
>
Application information:
Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
Trust level: Full
Application Virtual Path: /
Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
Machine name: STAGE1
>
Process information:
Process ID: 6300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
>
Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK 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 28 '07 #11

P: n/a
You might right come to think of it. I just get picky about
"no" exceptions at all.

--
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:OW**************@TK2MSFTNGP04.phx.gbl...
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**@eggheadcafe.comwrote in message
news:%2****************@TK2MSFTNGP05.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**************@TK2MSFTNGP05.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**@eggheadcafe.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl.. .
True. One possiblity "might" be Server.Transfer and Response.Redirect
and not using a return statement right afterwards.

Response.Redirect("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*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
>Event sequence: 1342
>Event occurrence: 6
>Event detail code: 0
>>
>Application information:
> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
> Trust level: Full
> Application Virtual Path: /
> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
> Machine name: STAGE1
>>
>Process information:
> Process ID: 6300
> Process name: w3wp.exe
> Account name: NT AUTHORITY\NETWORK SERVICE
>>
>Request information:
> Request URL:
> Request path:
> User host address:
> User:
> Is authenticated: False
> Authentication Type:
> Thread account name: NT AUTHORITY\NETWORK 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 28 '07 #12

P: n/a
It is logging a database error, it's a Foreign Key constraint error, but
that should be picked up by the Catch and throw an Unhandled exeption.

I did read an article about these Unhandle Exceptions that said go to VS
Options Debugging\General and uncheck Enable Just My Code, this keeps the
Unhandled exception from happening when in Debug mode, but is this just
masking the problem?

"Robbe Morris - [MVP] C#" <in**@eggheadcafe.comwrote in message
news:ev**************@TK2MSFTNGP02.phx.gbl...
Is it actually logging a database error anywhere?

You might want to put a line to exit out of the database
error logging method prior to it performing any action.

It would be interesting to see if something funny
is going on down there....

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


"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>>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**************@TK2MSFTNGP02.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("DataLayerName", ExceptionObject)
George.
"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP03.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
logexceptionfromDatalayer(EX)
End Try
Public Function runSQL(ByVal SQL As String) As Boolean

Try

execute the query here

Catch ExceptionObject As Exception

logexception(ExceptionObject )

Throw New Exception("DataLayerName", ExceptionObject)

Finally

'Clean up

End Try

End Function


"George Ter-Saakov" <gt****@cardone.comwrote in message
news:uC*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
>Event sequence: 1342
>Event occurrence: 6
>Event detail code: 0
>>
>Application information:
> Application domain: /LM/W3SVC/1203720951/Root-6-128353913468396400
> Trust level: Full
> Application Virtual Path: /
> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
> Machine name: STAGE1
>>
>Process information:
> Process ID: 6300
> Process name: w3wp.exe
> Account name: NT AUTHORITY\NETWORK SERVICE
>>
>Request information:
> Request URL:
> Request path:
> User host address:
> User:
> Is authenticated: False
> Authentication Type:
> Thread account name: NT AUTHORITY\NETWORK 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 28 '07 #13

P: n/a
I meant to say:

It is logging a database error, it's a Foreign Key constraint error, but
that should be picked up by the Catch and NOT throw an Unhandled exeption.

"Rick" <rf*****@newsgroups.nospamwrote in message
news:uV**************@TK2MSFTNGP04.phx.gbl...
It is logging a database error, it's a Foreign Key constraint error, but
that should be picked up by the Catch and throw an Unhandled exeption.

I did read an article about these Unhandle Exceptions that said go to VS
Options Debugging\General and uncheck Enable Just My Code, this keeps the
Unhandled exception from happening when in Debug mode, but is this just
masking the problem?

"Robbe Morris - [MVP] C#" <in**@eggheadcafe.comwrote in message
news:ev**************@TK2MSFTNGP02.phx.gbl...
>Is it actually logging a database error anywhere?

You might want to put a line to exit out of the database
error logging method prior to it performing any action.

It would be interesting to see if something funny
is going on down there....

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


"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>>>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**************@TK2MSFTNGP02.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("DataLayerName", ExceptionObject)
George.
"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP03.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
logexceptionfromDatalayer(EX)
End Try
>
>
Public Function runSQL(ByVal SQL As String) As Boolean
>
Try
>
execute the query here
>
Catch ExceptionObject As Exception
>
logexception(ExceptionObject )
>
Throw New Exception("DataLayerName", ExceptionObject)
>
Finally
>
'Clean up
>
End Try
>
End Function
>
>
>
>
"George Ter-Saakov" <gt****@cardone.comwrote in message
news:uC*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
>news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
>>Event sequence: 1342
>>Event occurrence: 6
>>Event detail code: 0
>>>
>>Application information:
>> Application domain:
>>/LM/W3SVC/1203720951/Root-6-128353913468396400
>> Trust level: Full
>> Application Virtual Path: /
>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>> Machine name: STAGE1
>>>
>>Process information:
>> Process ID: 6300
>> Process name: w3wp.exe
>> Account name: NT AUTHORITY\NETWORK SERVICE
>>>
>>Request information:
>> Request URL:
>> Request path:
>> User host address:
>> User:
>> Is authenticated: False
>> Authentication Type:
>> Thread account name: NT AUTHORITY\NETWORK 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 28 '07 #14

P: n/a
Got me on this one. My view has always been

try
{
}
catch (whateverException) { throw; }

from the bottom all the way back up to the UI or
highest level endpoint before deciding how to handle the error.
This forces the application environment to manage this
process.

Not saying your way is wrong. Just saying I've never
opted to managing logging and handling of the same error
in multiple places.

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


"Rick" <rf*****@newsgroups.nospamwrote in message
news:u$**************@TK2MSFTNGP02.phx.gbl...
>I meant to say:

It is logging a database error, it's a Foreign Key constraint error, but
that should be picked up by the Catch and NOT throw an Unhandled exeption.

"Rick" <rf*****@newsgroups.nospamwrote in message
news:uV**************@TK2MSFTNGP04.phx.gbl...
>It is logging a database error, it's a Foreign Key constraint error, but
that should be picked up by the Catch and throw an Unhandled exeption.

I did read an article about these Unhandle Exceptions that said go to VS
Options Debugging\General and uncheck Enable Just My Code, this keeps the
Unhandled exception from happening when in Debug mode, but is this just
masking the problem?

"Robbe Morris - [MVP] C#" <in**@eggheadcafe.comwrote in message
news:ev**************@TK2MSFTNGP02.phx.gbl...
>>Is it actually logging a database error anywhere?

You might want to put a line to exit out of the database
error logging method prior to it performing any action.

It would be interesting to see if something funny
is going on down there....

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


"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
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**************@TK2MSFTNGP02.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("DataLayerName", ExceptionObject)
>
>
George.
>
>
"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP03.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
> logexceptionfromDatalayer(EX)
>End Try
>>
>>
>Public Function runSQL(ByVal SQL As String) As Boolean
>>
>Try
>>
> execute the query here
>>
>Catch ExceptionObject As Exception
>>
> logexception(ExceptionObject )
>>
> Throw New Exception("DataLayerName", ExceptionObject)
>>
>Finally
>>
>'Clean up
>>
>End Try
>>
>End Function
>>
>>
>>
>>
>"George Ter-Saakov" <gt****@cardone.comwrote in message
>news:uC*************@TK2MSFTNGP06.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*****@newsgroups.nospamwrote in message
>>news:O%****************@TK2MSFTNGP02.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: e491a210450c499da175a8f79bda9e4e
>>>Event sequence: 1342
>>>Event occurrence: 6
>>>Event detail code: 0
>>>>
>>>Application information:
>>> Application domain:
>>>/LM/W3SVC/1203720951/Root-6-128353913468396400
>>> Trust level: Full
>>> Application Virtual Path: /
>>> Application Path: D:\Hosting\digecenterv2.com\www-stage\html\
>>> Machine name: STAGE1
>>>>
>>>Process information:
>>> Process ID: 6300
>>> Process name: w3wp.exe
>>> Account name: NT AUTHORITY\NETWORK SERVICE
>>>>
>>>Request information:
>>> Request URL:
>>> Request path:
>>> User host address:
>>> User:
>>> Is authenticated: False
>>> Authentication Type:
>>> Thread account name: NT AUTHORITY\NETWORK 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 28 '07 #15

This discussion thread is closed

Replies have been disabled for this discussion.