When you access an ASP.NET page in your browser, you may get an XML Parsing Error that says that the XML is not well formed. The error message also displays the page directive statement present in the 1st line of the .aspx file. First we will fix this error, then we will look at one possible reason why you may be getting this error in ASP.NET.

Fix the ‘XML Parsing Error’
Click Start > Run, and type the following command depending on which ASP.NET framework is in use by the default web site in your IIS.
ASP.NET 2.0 Framework
%Windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
ASP.NET 1.1 Framework
%Windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
You should see a command window that is displayed briefly, that shows that ASP.NET is being installed. After the registration is successful, the window will be closed. 
Now refresh the .aspx page that you got the XML Parser error for in the browser and your page should be rendered correctly.
Why did you get this error ?
I have seen this error happen to me in situations where I had installed IIS after the installing the .Net Framework. This make sense. If you install IIS after you install the .Net Framework, then the framework is not registered with IIS. So when a request for a .aspx page comes to IIS, it simply passes on the contents of the page as-is without processing it. So in effect, the browser receives the entire .aspx page’s code, tried to parse it as an XML file, encounters the parsing error at the second character in the page directive and stops.
Related: ASP.NET IIS Registration Tool







1443
Thanks for the tip! I am a asp.net newbie, and this really helped me to get started with learning it.
-Naved
1442
Thanx, this helped me a lot
1441
Thank you very much. It works
1440
Cheers worked.
1439
Thanks! This is a very clear and concise page and helped me out big time! Cheers!
1395
Thank you very much! It worked…
1396
thanks a lot. It really helped.
1446
thanks man it really helped me
great thinking
1445
This is very clear and it is working for me now.
Thanks a lot!
1444
On secured machines, this may also be caused if you’ve removed mappings for particular files in the IIS Manager. If this is happening, go into the IIS Manager, right-click on your web, choose properties. Then click the Home Directory tab and the Configuration button.
Make sure the Application Extension for that particular extension is mapped to the aspnet_isapi.dll and at least the verbs “GET,POST” are in there.
1433
Thank you so much….very helpful tip…working for me now..thanks
1438
I just google my problem and found this. Correct and perfect answer, thank you guy!
1437
thank you! as others have said, this works perfectly.
1436
i am new to asp.net … i developed a website in VS in which I access an XML file ..i wanted it to run as a browser independent one . I wrote different codes for IE and other browser both the codes were running well individually but when i combine them … it works well in IE but it does not work in MOzilla and i get the above error. Please help me out …..
1435
thanks a bunch!!
1434
Thanks so much, it really help me!!
1432
I solved this problem, all my files were read only…and i unchecked read only…And it works..
1431
I want to run an aspx file after uploading it to remote server. When i tried to run in browser, the same error is appearing. I didnt find any property in IIS manager of the server.Please help me.
1430
Thank you so much.
It has solved my problem.
Really Thanks from the heart.
1429
Thanks i am asp.net developer and this problem is really troubling me
1428
THX U wery much, real help for newbies
1420
Great work man
1419
thanks,i have solved my problem.
this is excellent,not because u give solution,but u given solution of issue,and also why it happens.
thank u again.great
1422
Within the website’s properties, there’s a tab for ASP.NET. My ASP.NET version was blank, but 2.0.50727 was listed in the drop-down menu. Choosing this version and hitting apply worked for me.
1421
There’s a tab for ASP.NET in the website properties within IIS. My ASP.NET version was blank, but 2.x existed in the drop-down menu. Choosing this version and pressing apply solved my problem (well, I get a different error, but one that’s my fault).
1406
Cool stuff, thanks a lot, very helpful.
1427
My boss was very angry at me.Thanks so much for the support.
1426
Hey, thanks!!!!
It worked!!
1425
Thank you Sir
it helps me a lot
1424
Thank you very much.
1423
hello,
Thanks a lot for ur answer.. it helped me a lot.
1413
nice try..this did not work for me..any other possible causes?
1412
Cheers, worked a treat!
1411
when i try to run my web with vs.net it works properly. And when i run it without vs.net this comes out. please help me. here is my email. siedexxx @ yahoo.com please send me ideas. i cant go on with my projects -_-
1410
Thanks for this Tip!!
It really worked.
1409
Thanks for help..
1408
Thanks for the tip! I am a asp.net newbie, and this really helped me to get started with learning it.
1407
google brought me to yr spot and i don’t regret it.
good work!
1418
Thanks for all the efforts
1417
thank you, it worked! just like carl, are there any other causes?
1416
Thanks, you save my day!!!
1415
Thank you very much!!!
I started to go nuts about this!
1414
Thanks a lot.
I am really thankful keep it up to solve people’s problem God bless you and your team.
1405
You are a god among gods. I spent hours manually trying to figure out what the hell was going on. Many thanks.
1402
Thanks a lot !!
This problem suffered me a lot
Thanks again
1401
I don’t know but i still get the error
1404
Thank you….It really helped
1403
Thanks! I don’t understand it, but it’s fixed which is all I care about! Awesome!!!!
1400
Thank you very much. Most importantly u have mentioned the reason for the cause that is a great help.
1399
Thanks. But i see an error Server Application Unavailable
1398
Xml Parsing error (error code 29) Line 21, column 2 of file
239
This was really useful in solving the exact same problem. The “why did you get this error” made a whole lot of difference in understanding exactly how we got the error in the first place and how to get it fixed.
Just for record, the software we were trying implement was relying on an earlier version of .net, so changing the version used in “Properties” of the relevant virtual folder was part of the problem. Followed by the reinstall as mentioned above.
Much appreciated, thanks.
240
Open IIS .
Select DefaultWebsite->Properties->ASP.NET Tab
Then Select ASP.NET version from the Combobox.
Regards
RAJ
649
i have asp.net 2 and IIS 5 and i got this problem and try all your solution i wrote the command and change the property in virtual directory and no benefit then i uninstall vs2005 and IIS5 then install them again starting with IIS5 then vs2005
and no benefit i dont know what to do please
1374
Thanks wrked like a charm..
1376
Thank you very much!!!!
1377
first it didn’t work for me but i reinstall the iis and then register it. it works.
thanks
1536
thanks a lot man…
1539
thanks man…
1542
Thanx
its working fine, but my servername gets changes e.g
My servername is ABC it makes to “ABCASPNET” after publishing web site
1543
fabulous…..fantastic…….u rocked…man….maza aa gya..
1550
Wow!!
Thank you so much!!
My whole team was in trouble from last 2 days with it, now i have fixed it with your help.
Keep on man!
it’s really a good helpful post………..
Thank you so much again…….
1561
Thank you so much
1570
But I have installed .NET 3.5
In such case what can i do?
1572
@Yong. According to a response in this thread, it seems that “ASP.NET 3.5 runs on top of ASP.NET 2.0, almost like a service pack”.
Also, from this MSDN Article on aspnet_regiis.exe specific to .Net 3.5, it is still saying that you should register the 2.x aspnet_regiis.exe version.
So I would suggest you try this out first and see if that helps !
-Shiva
1573
You’re right
but every time i must use that command
what can i do?
I’ll appreciate if you suggest better way!
Thanks!
1574
The registration should be a 1 time thing. Are you having to do it every time ?
If yes, then can you try adding the Compilers section / Compiler directives in your web.config (see this thread for the actual code to add)
1802
Hi Shiva…
Thanks a lot… it helped ..!
appreciate the way you explained….
1808
I don’t normally leave message, but this time I must say thank you very much
1813
Thanks A Ton !!
U Gave Th Solution In Best Possible Way…
Thanks A Ton..
1825
Thank you very much
go on
1828
it really worked for me.. gr8 job…