Application variables lost in debug mode

Discussion in 'ASP .Net' started by msteinwender@gmail.com, Aug 29, 2005.

  1. Guest

    Here is the scoop and any help is appreciated!

    In my Global.asax file I am creating an object and setting that object
    to an Application("obj") variable. The object gets created with no
    problems and the application variable is set successfully to that
    object.

    Once the Global.asax page has finished the Application_Start routine
    the startUp page (deploy.aspx) is loaded. On that page my application
    variables are now null. Even application variables such as a string or
    integer are now set to NULL

    Here are my dev settings:
    Win XP
    IIS 6 & IIS 5 (not sure if that is an issue)
    IE 6
    Web.config file <sessionState mode="InProc"
    I am debugging on my local machine (no web farm)
    No framesets
    Cookies Enabled

    I have spent most of the day reading articles and experimenting with
    different solutions to similar issues to no avail. So I am posting my
    problem with the hope that someone can help me.

    Thanks in advance!
    , Aug 29, 2005
    #1
    1. Advertising

  2. one thing it could be, assuming you have covered ALL your bases, the
    application pool could be restarting. I'm not sure why that would happen
    though but it would cause your objects to be lost. To either confirm or rule
    it out, check your eventwr to see if the processes were recycled.

    --
    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ www.lulu.com/owc
    Forth-coming VSTO.NET
    -------------------------------------------------------



    <> wrote in message
    news:...
    > Here is the scoop and any help is appreciated!
    >
    > In my Global.asax file I am creating an object and setting that object
    > to an Application("obj") variable. The object gets created with no
    > problems and the application variable is set successfully to that
    > object.
    >
    > Once the Global.asax page has finished the Application_Start routine
    > the startUp page (deploy.aspx) is loaded. On that page my application
    > variables are now null. Even application variables such as a string or
    > integer are now set to NULL
    >
    > Here are my dev settings:
    > Win XP
    > IIS 6 & IIS 5 (not sure if that is an issue)
    > IE 6
    > Web.config file <sessionState mode="InProc"
    > I am debugging on my local machine (no web farm)
    > No framesets
    > Cookies Enabled
    >
    > I have spent most of the day reading articles and experimenting with
    > different solutions to similar issues to no avail. So I am posting my
    > problem with the hope that someone can help me.
    >
    > Thanks in advance!
    >
    Alvin Bruney - ASP.NET MVP, Aug 29, 2005
    #2
    1. Advertising

  3. Guest

    I checked the Event Viewer Application, Security and System logs and
    there is no activity there. Thanks for your suggestion Alvin.........I
    was hoping it would help. You gave me a hand with some OWC stuff a
    while back and that was very usefull.
    Do you have any other suggestions?

    It does not seem that the application is restarting considering the
    object takes approx 20 seconds to load into memory as serializable
    , Aug 29, 2005
    #3
  4. Guest

    Ok this is what happened.......really stupid but hey what can I do
    about it now.

    Before the Page_Load I was assigning a local variable to the
    Application("obj") and the page was crapping out there, it appeared
    that my Application sessions were being lost

    So I moved my object variable into the page load and there was my
    Application variable. So lesson is don't set any variables to sessions
    outside of the Page_load event

    Thanks Alvin for your advice. I will remember to look there if any else
    funny starts happening.

    Cheers
    , Aug 29, 2005
    #4
    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. Dave
    Replies:
    0
    Views:
    639
  2. =?Utf-8?B?TWF4?=
    Replies:
    0
    Views:
    463
    =?Utf-8?B?TWF4?=
    Feb 11, 2006
  3. rbg
    Replies:
    0
    Views:
    428
  4. sujeet
    Replies:
    5
    Views:
    573
    Bart van Ingen Schenau
    Sep 16, 2007
  5. Replies:
    1
    Views:
    243
    Peter Zolja
    Jan 31, 2007
Loading...

Share This Page