配置系统初始化失败

配置系统初始化失败,第1张

配置系统初始化失败

确保项目中的配置文件(如果是web则为web.config,如果是Windows则为app.config)以以下方式启动:

<?xml version="1.0"?><configuration>    <configSections>        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="YourProjectName.Properties.Settings"type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"requirePermission="false" />        </sectionGroup>    </configSections></configuration>

请注意,在

configuration
元素内部,第一个孩子必须是
configSections
元素。

在element 的

name
属性中
section
确保将其替换
YourProjectName
为实际项目的名称。

我碰巧在一个类库项目中创建了一个Web服务,然后将配置文件(以实现端点配置)复制(覆盖)到我的Windows应用程序中,开始出现同样的问题。我无意中搬走了

configSections

它对我有用,希望对您有所帮助



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5042757.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-15
下一篇 2022-11-15

发表评论

登录后才能评论

评论列表(0条)

保存