Solved

Parser Error Message: There are multiple root elements.

Posted on 2016-08-24
9
102 Views
Last Modified: 2016-08-26
Hi,

could someone help me to understand the following what this error message.

                                If I run my web site under V4 I got following error :

-----------------------------------------------------------------------------------------------------------------------------
Server Error in '/' Application.

An unexpected network error occurred.
 
  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.IO.IOException: An unexpected network error occurred.


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:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                   
           
                                             But If I run the web site under V2, then I got the following message.

brachsites is another sites on the same IIS


Configuration Error
  Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

 Parser Error Message: There are multiple root elements. Line 198, position 2.

Source Error:

Line 198:</configuration>
Line 199:
Line 200:<location path="brachsites" allowOverride="true">
Line 201:    <system.web>
Line 202:        <trust level="Full" originUrl=""/>


Source File:  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config    Line:  200


Version Information: Microsoft .NET Framework Version:2.0.50727.8009; ASP.NET Version:2.0.50727.8015

Thanks in advance
0
Comment
Question by:toronto2456
  • 5
  • 2
  • 2
9 Comments
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 41769623
>>Parser Error Message: There are multiple root elements. Line 198, position 2.
the setting of line 200 onwards, which is " <location path="brachsites" allowOverride="true"> "... should be put within the <configuration> tag. which mean should be put before line: 199.

or simply remark from line: 199 onwards.
0
 

Author Comment

by:toronto2456
ID: 41770180
Hi Ryan,

Thanks very much for your comment. I am not too knowledgeable with the syntax.

How should I remark from line 199

or Should I just remove the line

Line 198:</configuration>
Line 199:<location path="brachsites" allowOverride="true">
Line 200:
Line 201:    <system.web>
Line 202:        <trust level="Full" originUrl=""/>

and why is that I am having different error message when I changed to the .Net version 4

Thanks

F.
0
 
LVL 27

Expert Comment

by:Dan McFadden
ID: 41770401
The comment format for a web.config is like so:

<--! My comments go here -->

To comment out an entire section, as Ryan suggested, you would insert a line above the line you wanted to start at, enter the first part of the comment "<!--" then go to the last line of what you want to comment out, and under that last line, insert a line and place the last part of the comment there "-->"

Everything in between the the comment start/stop, will not be used by the application.

For example, with a web.config that looks like:

</configuration>
<location path="brachsites" allowOverride="true">

    <system.web>
        <trust level="Full" originUrl=""/>

Open in new window


You would comment out like the following:

</configuration>
<!--
<location path="brachsites" allowOverride="true">

    <system.web>
        <trust level="Full" originUrl=""/>
-->

Open in new window


Dan
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:toronto2456
ID: 41770579
I will try this one but When I look at the code, I don't see any multiple entries,

let me try this one

Thanks

F.
0
 

Author Comment

by:toronto2456
ID: 41770593
this is in the machine .config file , not in the web.config

Thanks

F.
0
 

Assisted Solution

by:toronto2456
toronto2456 earned 0 total points
ID: 41770629
Hi Dan / Ryan ,

Thanks for your input. I have tried to modify the machine.config file as follows

----------------------------------------------------------------------------------------------------------------------------
</configuration>
<!--
<location path="brachsites" allowOverride="true">
    <system.web>
        <trust level="Full" originUrl=""/>
-->        
    </system.web>
</location>
This is end of the file.
---------------------------------------------------------------------------------------------------------------------------------------
and this time i got this error messages and again this happens if I run it under V2, if I run under V4, I won't get this message but different message.

Parser Error Message: Unexpected end tag. Line 202, position 7.
Source Error:
Line 200:        <trust level="Full" originUrl=""/>
Line 201:-->        
Line 202:    </system.web>
Line 203:</location>

 

 Source File:  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config    Line:  202

Thanks

F.
0
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41771143
make sure each of the tag in machine.config are closed properly?

in general, the machine.config will be validated according to XML syntax. The link below could  be helpful to you for tags validation.

XML Validator
http://www.w3schools.com/xml/xml_validator.asp
0
 
LVL 27

Expert Comment

by:Dan McFadden
ID: 41771322
Let's take a step back.... exactly why are you directly modifying the machine.config?

Do you have the original or a clean copy of the file before you started editing it?

IMO, modifying this file is only a source of headache and needs to be done only is rare and very specific cases.

Dan
0
 

Author Comment

by:toronto2456
ID: 41771662
Thanks Guys,,

Yes, actually I have never modified anything on the server. I just copy the file and work on the copy.

But let me share what i have learned. I have been troubleshooting IIS for 4 months now everyday and I learned that most of time error messages we are getting does have no relation with the original cause. I am not sure why. When ever I got an error message, It turns out to be completeyl different thing.

In this case as well, problem doesn't originated from machine .config file but from some other causes.

Thanks for the input guys

F.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question