漂亮蓝影 发表于 2018-12-8 08:16:13

IIS 访问出现 EntityName 时出错

  “/”应用程序中的服务器错误。
  --------------------------------------------------------------------------------
  

  分析 EntityName 时出错。 第 20 行,位置 22。
  说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
  

  异常详细信息: System.Xml.XmlException: 分析 EntityName 时出错。 第 20 行,位置 22。
  

  源错误:
  

  执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
  

  堆栈跟踪:
  

  

  
  System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +195
  System.Xml.XmlTextReaderImpl.ParseEntityName() +3401923
  System.Xml.XmlTextReaderImpl.ParseEntityReference() +64
  System.Xml.XmlTextReaderImpl.Read() +7409741
  System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) +101
  System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +74
  System.Xml.XmlDocument.Load(XmlReader reader) +144
  System.Xml.XmlDocument.Load(String filename) +205
  ZinEngine.Framework.ZinConfiguration..ctor(String path) +112
  Patrix.Web.PatrixConfig.Register(String path) +1852
  Patrix.Web.Global.Application_Start() +507
  

  
  System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12584905
  System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
  System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
  System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
  System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
  

  
  System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12601936
  System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
  System.Web.HttpRuntime.Proce***equestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12441597
  

  

  --------------------------------------------------------------------------------
  版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.34009
  

  

  查询原因得知以上都是因为配置文件里DB的密码出现了特殊字符引起的
  处理方法为: 替换编码或者重新更改密码,最好是更改一个不含特殊字符的密码
  

读取xml文件"分析 EntityName 时出错"的解决方案
在涉及到xml与xslt编程的过程中,经常会碰到"分析 EntityName 时出错"的提示,这个不是程序错误,是因为xml文件中使用了一些特殊符号导致的。
    XML 节点中不能包含这些特殊字符,“&”,“”,不然解析时此XML会报错,如果你配置文件中的节点内容包含了下面特殊符号,请用对应替换编码替换掉即可。
特殊字符特殊含义替换编码>
>
页: [1]
查看完整版本: IIS 访问出现 EntityName 时出错