事件日志有错误。 “发生了未处理的异常”

发布于 2024-09-28 07:33:45 字数 4007 浏览 0 评论 0原文

我正在使用 Visual Studio 2005 和 IIS 6.0..我在事件日志中看到此警告。我正在努力寻找它是什么。我工作的时候从来没有遇到过这种异常。 可以做什么以及在哪里可以做才能不再收到异常警告。非常感谢!

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 10/13/2010 3:20:26 PM 
Event time (UTC): 10/13/2010 7:20:26 PM 
Event ID: fba7eb72412b4383a4c94bfcfd5c81a1 
Event sequence: 708 
Event occurrence: 6 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/568802591/Root-1-129314697219905000 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: C:\Inetpub\wwwroot\kjdfd.live\ 
    Machine name: VME1053 

Process information: 
    Process ID: 472 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: NullReferenceException 
    Exception message: Object reference not set to an instance of an object. 

Request information: 
    Request URL: https://www.kjdfd.com:443/UserTownPage.aspx?tid=0 
    Request path: /UserTownPage.aspx 
    User host address: 173.188.124.86 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 11 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at UserTownPage.Page_Load(Object sender, EventArgs e)
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details: 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

页面加载:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            SearchType = CommonHelper.SearchInnerType.Distance;
            MakeActive(SearchType);
            LoadData(true);
        }
    }

private void MakeActive(CommonHelper.SearchInnerType sType)
    {
        DealsActive.Attributes.Remove("class");
        PopularActive.Attributes.Remove("class");
        DistanceActive.Attributes.Remove("class");
        AZActive.Attributes.Remove("class");
        switch (sType)
        {
            case CommonHelper.SearchInnerType.A_Z:
                AZActive.Attributes.Add("class", "current");
                break;
            case CommonHelper.SearchInnerType.Distance:
                DistanceActive.Attributes.Add("class", "current");
                break;
            case CommonHelper.SearchInnerType.Popular:
                PopularActive.Attributes.Add("class", "current");
                break;
            case CommonHelper.SearchInnerType.Deals:
                DealsActive.Attributes.Add("class", "current");
                break;
            default:
                AZActive.Attributes.Add("class", "current");
                break;
        }

    }



private void LoadData(bool isSetPageIndex)
    {
        if (Session["keyword"] != null && Session["city"] != null && Session["state"] != null
            && Session["zipcode"] != null && Session["radius"] != null && Session["category"] != null)
        {
            string keyword = Session["keyword"].ToString();
            string city = Session["city"].ToString();
            string state = Session["state"].ToString();
            string zipCode = Session["zipcode"].ToString();
            double radius = Convert.ToDouble(Session["radius"].ToString());
            int categoryID = Convert.ToInt32(Session["category"].ToString());
            if (isSetPageIndex) PageIndex = 1;
            DisplayRecords(keyword, city, state, zipCode, radius, categoryID, 1);
        }
    }

I am using Visual Studio 2005 and IIS 6.0.. I have this warning in the event log. I am trying to find what it is. I have never went through this exception when i am working.
What can be done and where can be done to not get the exception warning again. Thanks so much in advance!!

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 10/13/2010 3:20:26 PM 
Event time (UTC): 10/13/2010 7:20:26 PM 
Event ID: fba7eb72412b4383a4c94bfcfd5c81a1 
Event sequence: 708 
Event occurrence: 6 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/568802591/Root-1-129314697219905000 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: C:\Inetpub\wwwroot\kjdfd.live\ 
    Machine name: VME1053 

Process information: 
    Process ID: 472 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: NullReferenceException 
    Exception message: Object reference not set to an instance of an object. 

Request information: 
    Request URL: https://www.kjdfd.com:443/UserTownPage.aspx?tid=0 
    Request path: /UserTownPage.aspx 
    User host address: 173.188.124.86 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 11 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at UserTownPage.Page_Load(Object sender, EventArgs e)
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details: 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Page Load:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            SearchType = CommonHelper.SearchInnerType.Distance;
            MakeActive(SearchType);
            LoadData(true);
        }
    }

private void MakeActive(CommonHelper.SearchInnerType sType)
    {
        DealsActive.Attributes.Remove("class");
        PopularActive.Attributes.Remove("class");
        DistanceActive.Attributes.Remove("class");
        AZActive.Attributes.Remove("class");
        switch (sType)
        {
            case CommonHelper.SearchInnerType.A_Z:
                AZActive.Attributes.Add("class", "current");
                break;
            case CommonHelper.SearchInnerType.Distance:
                DistanceActive.Attributes.Add("class", "current");
                break;
            case CommonHelper.SearchInnerType.Popular:
                PopularActive.Attributes.Add("class", "current");
                break;
            case CommonHelper.SearchInnerType.Deals:
                DealsActive.Attributes.Add("class", "current");
                break;
            default:
                AZActive.Attributes.Add("class", "current");
                break;
        }

    }



private void LoadData(bool isSetPageIndex)
    {
        if (Session["keyword"] != null && Session["city"] != null && Session["state"] != null
            && Session["zipcode"] != null && Session["radius"] != null && Session["category"] != null)
        {
            string keyword = Session["keyword"].ToString();
            string city = Session["city"].ToString();
            string state = Session["state"].ToString();
            string zipCode = Session["zipcode"].ToString();
            double radius = Convert.ToDouble(Session["radius"].ToString());
            int categoryID = Convert.ToInt32(Session["category"].ToString());
            if (isSetPageIndex) PageIndex = 1;
            DisplayRecords(keyword, city, state, zipCode, radius, categoryID, 1);
        }
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦一生花开无言 2024-10-05 07:33:45

问题似乎是在 UserTownPage 类型的 Page_Load 方法中引发了 NullReferenceException。根据所提供的信息无法确定更多内容。

您需要做的是调试该方法并准确查看空引用发生的位置。

The problem appears to be a NullReferenceException is being thrown insed the Page_Load method of the UserTownPage type. More than that is not determinable from the information provided.

What you'll need to do is debug into that method and see exactly where the null reference is occuring.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文