ASP.NET XML Parsing Error: no element found Line Number 1, Column 1 Error

后端 未结 12 2440
[愿得一人]
[愿得一人] 2021-02-20 05:44

Hey I found a weird temperamental page which randomly gives me the following error

XML Parsing Error: no element found
Location: http://kj2011/site_2011/nonprofit-data         


        
相关标签:
12条回答
  • 2021-02-20 06:06

    To find the issue you are having with this problem.

    In your global.asax file add:

    void Application_Error(object sender, EventArgs e)
    {
        Exception objErr = Server.GetLastError().GetBaseException();
        string err =    "Error caught in Application_Error event" +                
                "\n \nError Message: " + objErr.Message.ToString()+ 
                "\n \nStack Trace: " + objErr.StackTrace.ToString();
    
           System.Diagnostics.EventLog.WriteEntry("MYApplication", err, System.Diagnostics.EventLogEntryType.Error);
        Server.ClearError();     
    } 
    

    You can set a break point here or log this message into an EventLog.

    0 讨论(0)
  • 2021-02-20 06:06

    When the rewrite of the url in web.config has a problem - the browser send 404 error. Try to comment all the rules and check again if the 404 error arise.

    0 讨论(0)
  • 2021-02-20 06:07

    In my case it was the AjaxControlToolkit.dll that was missing from the bin folder. Adding a breakpoint in the Application_Error method in global.asax as suggested above allowed me to find this out.

    0 讨论(0)
  • 2021-02-20 06:07

    Just for the future reference, in case people come here from google

    According to this thread, there are many different reasons to get this error. In my case this caused by overriding override void Render(System.Web.UI.HtmlTextWriter writer)

    and I have not called base.Render(writer); at the end of overridden function.

    0 讨论(0)
  • 2021-02-20 06:11

    I met the same problem, in my case, I lost a ';' in a syntax.

    0 讨论(0)
  • 2021-02-20 06:13

    some time This type of error occurs when you have app_offline.html file in your directory.When ASP.Net found a file names app_offline.htm in the root of a web application directory, it shut-down the application, unload the application domain from the server, and stop processing any new incoming requests for that application. ASP.NET also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file. The default content is an error message.

    0 讨论(0)
提交回复
热议问题