This project is read-only.

Upgrade from 1.6 to 2.0: Root element is missing

Jan 24, 2011 at 4:12 PM
Edited Jan 24, 2011 at 4:14 PM


I am trying to upgrade from v1.6 to v2.0. I extracted all the contents of the 2.0 archive and tested the web site. Everything is running fine. Next I copy all the contents of the App_Data folder from the v1.6 backup to the v2.0 App_Data folder and then I get the following exception. It is something related to the posts somehow. Any help is appreciated.

Server Error in '/' Application.

Root element is missing. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Xml.XmlException: Root element is missing.

Source Error: 

Line 45: 		{
Line 46:             PostList1.ContentBy = ServingContentBy.AllContent;
Line 47: 			PostList1.Posts = Post.Posts.ConvertAll(new Converter<Post, IPublishable>(delegate(Post p) { return p as IPublishable; }));
Line 48: 			if (!BlogSettings.Instance.UseBlogNameInPageTitles)
Line 49: 				Page.Title = BlogSettings.Instance.Name + " | ";

Source File: c:\inetpub\wwwroot\BlogEngine.Web\default.aspx.cs    Line: 47 

Stack Trace: 

[XmlException: Root element is missing.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +76
   System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) +61
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +3979720
   System.Xml.XmlTextReaderImpl.Read() +151
   System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +112
   System.Xml.XmlDocument.Load(XmlReader reader) +108
   System.Xml.XmlDocument.Load(String filename) +87
   BlogEngine.Core.Providers.XmlBlogProvider.SelectPost(Guid id) in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\Providers\XmlProvider\Posts.cs:211
   BlogEngine.Core.Post.DataSelect(Guid id) in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\Post.cs:1307
   BlogEngine.Core.BusinessBase`2.Load(TKey id) in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\BusinessBase.cs:303
   BlogEngine.Core.Providers.XmlBlogProvider.<FillPosts>b__15(String id) in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\Providers\XmlProvider\Posts.cs:68
   System.Linq.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x) +32
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +78
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +7667540
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +61
   BlogEngine.Core.Providers.XmlBlogProvider.FillPosts() in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\Providers\XmlProvider\Posts.cs:63
   BlogEngine.Core.Post.get_Posts() in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\Post.cs:215
   _default.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\BlogEngine.Web\default.aspx.cs:47
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   BlogEngine.Core.Web.Controls.BlogBasePage.OnLoad(EventArgs e) in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\Web\Controls\BlogBasePage.cs:317
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016 

Jan 24, 2011 at 7:29 PM

It looks like the file something's might be wrong with the file format of your XMl files in app_data\posts subdirectory.

You could open it in the browser, to see if the content is as expected.

Jan 24, 2011 at 10:20 PM

I have more than 500 posts and I opened randomly a few in the browser and they seem fine to me. I guess that all I can do is copy them over in blocks of 100 or so trying to isolate the issue.