XML解析错误:未组织好 的解决办法(解析xml数据异常)干货满满

随心笔谈2年前发布 admin
189 0 0

文章摘要

在开发一个基于.NET的网站时,用户遇到了在Windows系统下显示XML解析错误的问题,而Linux系统下可以正常显示。具体错误信息显示在Firefox 2.0中显示为“XML解析错误:未组织好”,而在IE中显示为“无法显示 XML 页”。经过进一步排查,发现原因是用户在安装Microsoft Visual Studio(包含.NET Framework 2.0)后,再安装IIS(Microsoft Internet信息服务),导致.NET框架未正确注册。用户通过运行命令`C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_regiis.exe -i`解决了问题,IIS成功注册了.NET框架,页面问题得以解决。 这篇文章主要围绕如何解决因安装顺序不当导致的IIS无法注册.NET框架而产生的XML解析错误进行了介绍。


主要问题:XML文件完整,在liunx系统下可正常显示,但是windows系统提示出错,

I use iis to develope a new .net website. I promise the code is right, but most pages running in Firefox 2.0 reported this error:

复制代码 代码如下:

XML解析错误:未组织好

位置:http://localhost/Lanxum/dTeam.aspx

行:1,列:2

< %@ page language=”C#” masterpagefile=”~/MasterPage.master” autoeventwireup=”true” inherits=”dTeam, App_Web_hkuu-y0n” title=”Untitled Page” theme=”iAffron” stylesheettheme=”iAffron” %> -^

And in IE, error reported as below:

复制代码 代码如下:

无法显示 XML 页。字符开头。

处理资源 ‘http://localhost/Lanxum/default.aspx’ 时出错。

第 1 行,位置: 2

The reason is that I install visual studio first(together with .net framework 2.0) and then install IIS. It made .net FK didn’t register in IIS. Just run this command with DOS:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

Once if you have install .net FK and IIS correctly, this sentence will follow:

开始安装 ASP.NET 。

…………………………………..

ASP.NET 安装完毕

Then refresh the page, you will find that the problem is fixed.

您可能感兴趣的文章:android通用xml解析方法android layout XML解析错误的解决方法基于Android XML解析与保存的实现c#中XML解析文件出错解决方法iOS开发中常见的解析XML的类库以及简要安装方法iOS开发使用XML解析网络数据

© 版权声明

相关文章