Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2009, 03:00 PM
Registered User
 
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default object reference not set to an instance of an object

Hi

object reference not set to an instance of an object

I get this error after a time of using the web application on the server. I restart the IIS and the problem is solved, but again after a time the same error.

anyone have any idea about the cause of this error?

I'm using Class, singleton class
Framework 3.5, Windows Server 2003

Thanks
 
Old December 4th, 2009, 03:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi..

Somebody, somehow, is closing the object, so you lost it..

You will have to log all the things that happens on the object, specially the point where it gets closed, so you can know who close it...
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old December 4th, 2009, 03:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Are you possibly storing someting in a session variable?
Is the "after some time" about 20 minutes?
You may need to test its existance before using and then reinstate when it is not there.
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================
 
Old December 4th, 2009, 03:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

of course if you are using hte app costantly, the session shouldn't be an issue
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================
 
Old December 4th, 2009, 03:34 PM
Registered User
 
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Exactly, I'm using the application costantly and when it happens all users who enter first time get the same message.
 
Old December 14th, 2009, 03:45 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Which object does it relate to in your code?

Temporarily Set Debug = true to find out.

If you can't work out from the resultant error what is the the cause of the problem then please post the relevant code on this forum.


One thought, are you using a session variable to update a database field with the value of the session variable? If so then when the session variable expires (20 minutes usually) then the next time you reference it then it won't be available and then new users won't be able to read the value from the database.

Unfortunately without more information we are all going to be guessing at the solution.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Object reference not set to an instance of an object. Michael YoeH ASP.NET 3.5 Professionals 5 August 23rd, 2009 02:07 PM
Object reference not set to an instance of an object. phuc2583 ASP.NET 3.5 Professionals 5 August 14th, 2009 10:56 AM
Chap 13 pg448: Object reference not set to an instance of an object tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 15 August 8th, 2009 06:14 AM
Object reference not set to an instance of object iceman90289 ASP.NET 3.5 Basics 1 March 1st, 2009 05:13 AM
Object Reference not set to an instance of object srinivas_chakka ASP.NET 1.0 and 1.1 Professional 0 February 8th, 2006 11:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.