This project is read-only.

Unexpected end of file has occurred. Error

Topics: ASP.NET 2.0
Mar 17, 2010 at 12:02 AM


All of a sudden I have started getting this error on my blog. Not sure what is wrong. Any thoughts? Please reply asap.


Line 85:     void Application_Start(object sender, EventArgs e)
Line 86: {
Line 87: Utils.LoadExtensions();
Line 88: }
Line 89:


[XmlException: Unexpected end of file has occurred. The following elements are not closed: Parameters, Settings, ManagedExtension. Line 1363, position 5.]
System.Xml.XmlTextReaderImpl.Throw(Exception e) +76
System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +126
System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String arg) +18
System.Xml.XmlTextReaderImpl.ThrowUnclosedElements() +254
System.Xml.XmlTextReaderImpl.ParseElementContent() +3977007
System.Xml.XmlTextReaderImpl.Read() +45
System.Xml.XmlTextReader.Read() +15
System.Xml.XmlReader.ReadElementString() +103
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderManagedExtension.Read3_ExtensionParameter(Boolean isNullable, Boolean checkType) +817
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderManagedExtension.Read4_ExtensionSettings(Boolean isNullable, Boolean checkType) +860
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderManagedExtension.Read5_ManagedExtension(Boolean isNullable, Boolean checkType) +1003
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderManagedExtension.Read6_ManagedExtension() +79

[InvalidOperationException: There is an error in XML document (1363, 5).]
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +613
System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) +102
ExtensionManager.DataStoreExtension(String name) in ExtensionManager.cs:263
ExtensionManager.LoadExtensions() in ExtensionManager.cs:210
ExtensionManager.ExtensionEnabled(String extensionName) in ExtensionManager.cs:55
BlogEngine.Core.Utils.LoadExtensions() in Utils.cs:543
ASP.global_asax.Application_Start(Object sender, EventArgs e) in d:\hosting\5734589\html\blog\Global.asax:87

[HttpException (0x80004005): There is an error in XML document (1363, 5).]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +407
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +130
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +176
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +296
System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +54
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +237

[HttpException (0x80004005): There is an error in XML document (1363, 5).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +546
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +78
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +334

Mar 17, 2010 at 12:12 AM

It looks like there could be an invalid or corrupted XML file used for Extensions.

I would first try re-starting the blog to see if that helps.  You can restart it by making any change to the web.config file (add a space, etc).

If you still get the error, I would try deleting (or moving to another location) the XML files in App_Data\datastore\extensions.  And then re-start the blog (as described above).  This is assuming you're using the default XML storage (not DB storage).

Mar 17, 2010 at 2:25 AM

I tried to delete xml files from the folder.  But no luck.

What do you mean by XML storage adn not DB storage?

I am using MySQL database for the blog.

Am I missing something?

Mar 17, 2010 at 3:08 AM

Got it... It was CommentRelish extension causing issue in db. Deleted rows from be_DataStoreSettings

Now it is working fine.


Thanks for pointing out the DB storage thing. Greatly appreciated.