新闻建站cms系统、政府cms系统定制开发

广州网站建设公司-阅速公司

asp.net新闻发布系统、报纸数字报系统方案
/
http://www.ysneo.com/
广州网站建设公司
您当前位置:首页>ASP.NET MVC

ASP.NET MVC

无法将类型为“System.Configuration.ConfigXmlComment”的对象强制转换为类型“System.Xml.XmlElement”

发布时间:2018/2/2 12:39:41  作者:Admin  阅读:300  

广告:阿里云采购优惠专区

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

无法将类型为“System.Configuration.ConfigXmlComment”的对象强制转换为类型“System.Xml.XmlElement”。

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

异常详细信息: System.InvalidCastException: 无法将类型为“System.Configuration.ConfigXmlComment”的对象强制转换为类型“System.Xml.XmlElement”。

源错误:

行 23: foreach (XmlNode sxn in xn.ChildNodes)

行 24: {

行 25: XmlElement xe = (XmlElement)sxn;

行 26: hht[xe.GetAttribute("key")] = xe.GetAttribute("value");

行 27: }

源文件: E:\aspnet2.0\hao_elec_all_jia\mvc_elec_jia\FeiShareLibrary\XmlCom.cs ?? 行: 25

堆栈跟踪:

[InvalidCastException: 无法将类型为“System.Configuration.ConfigXmlComment”的对象强制转换为类型“System.Xml.XmlElement”。]

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42

System.Web.UI.Control.OnLoad(EventArgs e) +132

System.Web.UI.Control.LoadRecursive() +66

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

版本信息:?Microsoft .NET Framework 版本:2.0.50727.8745; ASP.NET 版本:2.0.50727.8745

解决方法:因为Xml文件注释问题

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<appSettings>

<add key="appId" value="w" />

<add key="appSecret" value="" />

<!--开放平台网站应用参数,放在这里是错误的-->

</appSettings>

</configuration>

<!--开放平台网站应用参数,放在这里是对的-->

广告:阿里云新人采购专场

相关文章
XmlElement
cms新闻系统购买咨询
扫描关注 广州阅速软件科技有限公司
扫描关注 广州阅速科技