Session Stage\Variables

Discussion in 'ASP .Net' started by Rick, Sep 27, 2007.

  1. Rick

    Rick Guest

    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
    Rick, Sep 27, 2007
    #1
    1. Advertising

  2. 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,EventLogEntryType.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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




    "Rick" <> wrote in message
    news:O%...
    > 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
    >
    Robbe Morris - [MVP] C#, Sep 27, 2007
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:O%...
    > 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
    >
    George Ter-Saakov, Sep 27, 2007
    #3
  4. 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




    "George Ter-Saakov" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:O%...
    >> 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
    >>

    >
    >
    Robbe Morris - [MVP] C#, Sep 27, 2007
    #4
  5. 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#" <> wrote in message
    news:%...
    > 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >
    >
    >
    >
    > "George Ter-Saakov" <> wrote in message
    > news:...
    >> 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" <> wrote in message
    >> news:O%...
    >>> 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
    >>>

    >>
    >>

    >
    George Ter-Saakov, Sep 27, 2007
    #5
  6. It throws thread abort exceptions.

    --
    Robbe Morris [Microsoft MVP - Visual C#]
    ..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
    http://www.eggheadcafe.com/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




    "George Ter-Saakov" <> wrote in message
    news:...
    >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#" <> wrote in message
    > news:%...
    >> 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >>
    >>
    >>
    >>
    >> "George Ter-Saakov" <> wrote in message
    >> news:...
    >>> 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" <> wrote in message
    >>> news:O%...
    >>>> 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
    >>>>
    >>>
    >>>

    >>

    >
    >
    Robbe Morris - [MVP] C#, Sep 27, 2007
    #6
  7. 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#" <> wrote in message
    news:%...
    > It throws thread abort exceptions.
    >
    > --
    > Robbe Morris [Microsoft MVP - Visual C#]
    > .NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
    > http://www.eggheadcafe.com/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >
    >
    >
    >
    > "George Ter-Saakov" <> wrote in message
    > news:...
    >>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#" <> wrote in message
    >> news:%...
    >>> 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >>>
    >>>
    >>>
    >>>
    >>> "George Ter-Saakov" <> wrote in message
    >>> news:...
    >>>> 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" <> wrote in message
    >>>> news:O%...
    >>>>> 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
    >>>>>
    >>>>
    >>>>
    >>>

    >>
    >>

    >
    George Ter-Saakov, Sep 27, 2007
    #7
  8. Rick

    Rick Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:O%...
    >> 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
    >>

    >
    >
    Rick, Sep 27, 2007
    #8
  9. 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" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:...
    >> 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" <> wrote in message
    >> news:O%...
    >>> 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
    >>>

    >>
    >>

    >
    >
    George Ter-Saakov, Sep 27, 2007
    #9
  10. Rick

    Rick Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:%...
    >> 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" <> wrote in message
    >> news:...
    >>> 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" <> wrote in message
    >>> news:O%...
    >>>> 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
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Rick, Sep 27, 2007
    #10
  11. 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




    "George Ter-Saakov" <> wrote in message
    news:...
    > 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#" <> wrote in message
    > news:%...
    >> It throws thread abort exceptions.
    >>
    >> --
    >> Robbe Morris [Microsoft MVP - Visual C#]
    >> .NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
    >> http://www.eggheadcafe.com/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >>
    >>
    >>
    >>
    >> "George Ter-Saakov" <> wrote in message
    >> news:...
    >>>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#" <> wrote in message
    >>> news:%...
    >>>> 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >>>>
    >>>>
    >>>>
    >>>>
    >>>> "George Ter-Saakov" <> wrote in message
    >>>> news:...
    >>>>> 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" <> wrote in message
    >>>>> news:O%...
    >>>>>> 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
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>
    >>>

    >>

    >
    >
    Robbe Morris - [MVP] C#, Sep 28, 2007
    #11
  12. 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




    "Rick" <> wrote in message
    news:%...
    >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" <> wrote in message
    > news:...
    >> 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" <> wrote in message
    >> news:%...
    >>> 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" <> wrote in message
    >>> news:...
    >>>> 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" <> wrote in message
    >>>> news:O%...
    >>>>> 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
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Robbe Morris - [MVP] C#, Sep 28, 2007
    #12
  13. Rick

    Rick Guest

    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#" <> wrote in message
    news:...
    > 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >
    >
    >
    >
    > "Rick" <> wrote in message
    > news:%...
    >>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" <> wrote in message
    >> news:...
    >>> 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" <> wrote in message
    >>> news:%...
    >>>> 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" <> wrote in message
    >>>> news:...
    >>>>> 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" <> wrote in message
    >>>>> news:O%...
    >>>>>> 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
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    Rick, Sep 28, 2007
    #13
  14. Rick

    Rick Guest

    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" <> wrote in message
    news:...
    > 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#" <> wrote in message
    > news:...
    >> 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >>
    >>
    >>
    >>
    >> "Rick" <> wrote in message
    >> news:%...
    >>>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" <> wrote in message
    >>> news:...
    >>>> 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" <> wrote in message
    >>>> news:%...
    >>>>> 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" <> wrote in message
    >>>>> news:...
    >>>>>> 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" <> wrote in message
    >>>>>> news:O%...
    >>>>>>> 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
    >>>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>

    >
    >
    Rick, Sep 28, 2007
    #14
  15. 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx




    "Rick" <> wrote in message
    news:u$...
    >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" <> wrote in message
    > news:...
    >> 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#" <> wrote in message
    >> news:...
    >>> 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/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
    >>>
    >>>
    >>>
    >>>
    >>> "Rick" <> wrote in message
    >>> news:%...
    >>>>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" <> wrote in message
    >>>> news:...
    >>>>> 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" <> wrote in message
    >>>>> news:%...
    >>>>>> 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" <> wrote in message
    >>>>>> news:...
    >>>>>>> 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" <> wrote in message
    >>>>>>> news:O%...
    >>>>>>>> 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
    >>>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>

    >>
    >>

    >
    >
    Robbe Morris - [MVP] C#, Sep 28, 2007
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. salman sheikh

    4 stage register or fifo

    salman sheikh, Feb 18, 2004, in forum: VHDL
    Replies:
    2
    Views:
    517
    salman sheikh
    Feb 19, 2004
  2. Anoops
    Replies:
    1
    Views:
    625
    navneetcertain
    Aug 1, 2013
  3. Anoops
    Replies:
    0
    Views:
    516
    Anoops
    Sep 9, 2005
  4. Replies:
    3
    Views:
    2,147
  5. Brian Folke Seaberg

    Initialization -- One Stage or Two Stage

    Brian Folke Seaberg, Jan 4, 2005, in forum: C++
    Replies:
    4
    Views:
    721
    Howard
    Jan 4, 2005
Loading...

Share This Page