Root element is missing

Topics: General
Sep 2, 2011 at 2:30 PM

Hello,

I am having a problem publishing and Orchard site via Visual Studio 2010. If I publish the site setting 'only files needed to run this application' to a local directory I can run the site without any problems when set up as a site in IIS 7. However, when I ftp the published files to my staging server running IIS 6 I get the following error.

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: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[XmlException: Root element is missing.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +73
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +4116348
   System.Xml.XmlTextReaderImpl.Read() +145
   System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +44
   Orchard.Environment.Extensions.Compilers.DefaultProjectFileParser.Parse(TextReader reader) +28
   Orchard.Environment.Extensions.Compilers.<>c__DisplayClass1.b__0(AcquireContext`1 ctx) +117

 etc...

The only way I can get the site to work on the staging server is to ftp all the development files to the staging server i.e. without going through the VS publisher, this does however mean that I have to FTP 4000+ files instead of 2000+ files.

Has anyone had a similar problem / know what could be causing this?

Regards

Daniel

Coordinator
Sep 2, 2011 at 10:07 PM

There might be a coincidence going on here. That exception does not look environmental. It may work on one machine coincidentally because the project still ahs a previously compiled version still running, or something like that. I would first try to deploy locally to another IIS 7 site, just to isolate variables.

Sep 26, 2011 at 3:34 AM

I'm also having this same problem with a new orchard site I just built.  I used blog recipe and chose the default sql compact database.  I have previously deployed a site using sql express and did not have this issue.  Still digging into it and will post back here if I find a solution.

Sep 26, 2011 at 5:40 AM

I think my issue had something to do with a module - I some errors in logs about dependencies issues... some dependencies file somewhere.  Since this is a brand new site I deleted everything in app data and recreated the site.  Deployed to production and seems to be working fine now.  I'm also not using shared hosting but am using a rackspace virtual server.  I realize this answer doesn't really help the original poster, but one lesson to learn for me here is to add modules slowly - I had initially added about 4 or 5 that I new I wanted, but seems that one was causing an issue.  I had no way of knowing which one without a lot of digging.