文件路径没有问题但就是读取不到
ConfigurationSection section = config.GetSection(sectionName);
string xml = section.SectionInformation.GetRawXml();
执行上代码后xml的内容为空
System.ArgumentNullException: Value cannot be null.
Parameter name: s
at System.IO.StringReader..ctor (System.String s) [0x00009] in <5e6ced3750e44e2e834c261834a0e226>:0
at (wrapper remoting-invoke-with-check) System.IO.StringReader..ctor(string)
at dbconfig.GetConfigurationValues (System.Configuration.Configuration config, System.String sectionName) [0x0006c] in <169890f287f248958299b2cc1215dfc5>:0
at dbconfig.configReadValue (System.String Key) [0x00033] in <169890f287f248958299b2cc1215dfc5>:0
at MTHIS.db.DBProvider.initDBInfo () [0x00020] in <169890f287f248958299b2cc1215dfc5>:0
at BllMain.initDB () [0x00020] in <169890f287f248958299b2cc1215dfc5>:0
at DepartmentsAllBll.getJson (DepartmentsAll_in departments_in) [0x00066] in <169890f287f248958299b2cc1215dfc5>:0
作者:风 发布时间:20年06月03日 可选操作:
删除 回复查一查你xml中有没有比如 "\" 之类的字符。如果有中文,应该确保xml是以UTF8保存的。
作者:yunei 发布时间:20年06月07日 可选操作:
删除 回复