ASP.net Application Problem.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everyone!
I have uploaded my site on a webserver. Some times it works fine but some
time it gives error "Null Object reference exception".
The same site on my local server works just fine.

When I change the "global.ascx" and ".dll" file in "bin" directory, it
starts working fine but after some time, same problem arises again :(.

Can any one help me plz in figuring out the problem, and I wud highly
appreciate your suggestions and recommendations.

Thanks in anticipation.
 
null reference exceptions are a result of flakey code. Use the stack trace
to find out which line of code is causing the problem and fix it.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
 
Hello again!

It does not solve my problem bcz if there is problem in code then why it
works f9 on my local server.

If another solution plz, I wud be greatful. thanx and regards.


Alvin Bruney said:
null reference exceptions are a result of flakey code. Use the stack trace
to find out which line of code is causing the problem and fix it.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
zubair said:
Hello everyone!
I have uploaded my site on a webserver. Some times it works fine but some
time it gives error "Null Object reference exception".
The same site on my local server works just fine.

When I change the "global.ascx" and ".dll" file in "bin" directory, it
starts working fine but after some time, same problem arises again :(.

Can any one help me plz in figuring out the problem, and I wud highly
appreciate your suggestions and recommendations.

Thanks in anticipation.
 
Alvin is right, the error is coming from your code, please post some sample
code thats in your global.ascx and maybe someone can help you.

zubair said:
Hello again!

It does not solve my problem bcz if there is problem in code then why it
works f9 on my local server.

If another solution plz, I wud be greatful. thanx and regards.


Alvin Bruney said:
null reference exceptions are a result of flakey code. Use the stack trace
to find out which line of code is causing the problem and fix it.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
zubair said:
Hello everyone!
I have uploaded my site on a webserver. Some times it works fine but some
time it gives error "Null Object reference exception".
The same site on my local server works just fine.

When I change the "global.ascx" and ".dll" file in "bin" directory, it
starts working fine but after some time, same problem arises again :(.

Can any one help me plz in figuring out the problem, and I wud highly
appreciate your suggestions and recommendations.

Thanks in anticipation.
 
Hello Jorge Thank u for you reply:

here is the code of "global.ascx" plz check this and help me figureout the
problem, I would be greatfull.

//code
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using caribbeansearch.baseobjects;
using System.Resources;
using System.IO;
using System.Threading;
using System.Web.Mail;
namespace Zubair
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
public static string applicationPath="";
int count=0;
protected Zubair.baseobjects.WPUIObjects component;
public Global()
{
InitializeComponent();
}

protected void Application_Start(Object sender, EventArgs e)
{

applicationPath
=Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["SiteRootPath"]);
//WPDBProcedureMetaData MetaDataSPXML=new WPDBProcedureMetaData()
//MetaDataSPXML.LoadSPXMLStruct(applicationPath+System.Configuration.ConfigurationSettings.AppSettings["MetaDataXML"]);
//Thread thread = new Thread(new
ThreadStart(Zubair.baseobjects.Emailblaster.ProcessEmail ));
//thread.Start();
}

protected void Session_Start(Object sender, EventArgs e)
{
Session.Timeout=60;
++count;
Session["VisitorsCount"]=count;
}

protected void Application_BeginRequest(Object sender, EventArgs e)
{

}

protected void Application_EndRequest(Object sender, EventArgs e)
{

}

protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{

}

protected void Application_Error(Object sender, EventArgs e)
{
try
{
// component=new WPUIObjects();
// component.SendGenericEmail("(e-mail address removed)","(e-mail address removed)","Error
in the Site","The error description is as follows : "
+Server.GetLastError().ToString());
}
catch(Exception e1)
{
// string ss=e1.Message;
}
}

protected void Session_End(Object sender, EventArgs e)
{

}

protected void Application_End(Object sender, EventArgs e)
{
}

#region Web Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
}
#endregion
}
}

//end code.

thanx and regards.

Jorge L Matos said:
Alvin is right, the error is coming from your code, please post some sample
code thats in your global.ascx and maybe someone can help you.

zubair said:
Hello again!

It does not solve my problem bcz if there is problem in code then why it
works f9 on my local server.

If another solution plz, I wud be greatful. thanx and regards.


Alvin Bruney said:
null reference exceptions are a result of flakey code. Use the stack trace
to find out which line of code is causing the problem and fix it.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
Hello everyone!
I have uploaded my site on a webserver. Some times it works fine but some
time it gives error "Null Object reference exception".
The same site on my local server works just fine.

When I change the "global.ascx" and ".dll" file in "bin" directory, it
starts working fine but after some time, same problem arises again :(.

Can any one help me plz in figuring out the problem, and I wud highly
appreciate your suggestions and recommendations.

Thanks in anticipation.
 
Back
Top