Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

My application is on .net framework 2.0

Application was executing properly when I run the application.

I am facing the below error after I have hosted my application on the IIS 7(Windows 7 OS).
I have tried in google but couldnot find the solution. Please help me in solving a problem

Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 60: Timesheet_BAL.User objSheet = new Timesheet_BAL.User();
Line 61:
Line 62: lblwelcome.Text = "Welcome " + ((Timesheet_BAL.User)Session["currentuser"]).Empname.ToString(); Line 63: //lblwelcome.Text = "Welcome " + objSheet.Empname.ToString();
Line 64:

Source File: c:\Timesheet\UserControls\HeaderHome.ascx.cs Line: 62

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
TimeSheet.UserControls.HeaderHome.Page_Load(Object sender, EventArgs e) in c:\Timesheet\UserControls\HeaderHome.ascx.cs:62
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.4984; ASP.NET Version:2.0.50727.4971
Posted
Comments
Maarten Kools 22-Aug-13 11:36am    
You can attach your debugger to the IIS process and from there determine what is null and why.
ZurdoDev 22-Aug-13 20:35pm    
You have to figure out what is null. Likely one of your sessions vars.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900