Application variables lost in debug mode

M

msteinwender

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!
 
A

Alvin Bruney - ASP.NET MVP

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
 
M

msteinwender

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
 
M

msteinwender

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top