Hello Jorge Thank u for you reply:
here is the code of "global.asc x" plz check this and help me figureout the
problem, I would be greatfull.
//code
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Web;
using System.Web.Sess ionState;
using caribbeansearch .baseobjects;
using System.Resource s;
using System.IO;
using System.Threadin g;
using System.Web.Mail ;
namespace Zubair
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.Http Application
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.IContain er components = null;
public static string applicationPath ="";
int count=0;
protected Zubair.baseobje cts.WPUIObjects component;
public Global()
{
InitializeCompo nent();
}
protected void Application_Sta rt(Object sender, EventArgs e)
{
applicationPath
=Server.MapPath (System.Configu ration.Configur ationSettings.A ppSettings["SiteRootPa th"]);
//WPDBProcedureMe taData MetaDataSPXML=n ew WPDBProcedureMe taData()
//MetaDataSPXML.L oadSPXMLStruct( applicationPath +System.Configu ration.Configur ationSettings.A ppSettings["MetaDataXM L"]);
//Thread thread = new Thread(new
ThreadStart(Zub air.baseobjects .Emailblaster.P rocessEmail ));
//thread.Start();
}
protected void Session_Start(O bject sender, EventArgs e)
{
Session.Timeout =60;
++count;
Session["VisitorsCo unt"]=count;
}
protected void Application_Beg inRequest(Objec t sender, EventArgs e)
{
}
protected void Application_End Request(Object sender, EventArgs e)
{
}
protected void Application_Aut henticateReques t(Object sender, EventArgs e)
{
}
protected void Application_Err or(Object sender, EventArgs e)
{
try
{
// component=new WPUIObjects();
// component.SendG enericEmail("in **@Zubair.com", "in**@Zubair.co m","Error
in the Site","The error description is as follows : "
+Server.GetLast Error().ToStrin g());
}
catch(Exception e1)
{
// string ss=e1.Message;
}
}
protected void Session_End(Obj ect 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 InitializeCompo nent()
{
this.components = new System.Componen tModel.Containe r();
}
#endregion
}
}
//end code.
thanx and regards.
"Jorge L Matos [MCSD.NET]" wrote:
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" wrote:
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 [MVP - ASP.NET]" wrote:
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" <zu****@discuss ions.microsoft. com> wrote in message
news:5B******** *************** ***********@mic rosoft.com...
> 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.asc x" 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.