I think you might be misunderstanding the message.
The message is probably referring to the Session object
being nothing, not the content.
Session will never bomb out on an object being nothing in
the context you show. Session will be nothing in any
classes you create. Instead,
use "Current.Session.item..." and you should be able to
get your object just fine.
It helps to put a reference to:
System.Web.HttpContext
in your "Imports" in the project properties under the
properties page, Common Properties folder. Otherwise you
need to reference System.Web.HttpContext.Current.Session
Email if you need more...
-----Original Message-----
Ok...
in Global.asax I have:
protected void Session_Start(Object sender, EventArgs e)
{
cms.errorHandler error = new cms.errorHandler();
Session["error"] = error;
}
and then in my code I have:
errorHandler error = (errorHandler)Session["error"];
I get:
Object Reference not set to an instance of an object
(NullReferenceException).
I even get the Exception if I do:
Session["test"] = "Test";
Yes I debug the application
.