C# 配置系统未能初始化错误

C# 配置系统未能初始化错误,c#,winforms,C#,Winforms,我有一个错误,我在这一行得到的是赋值为空 db = DatabaseFactory.CreateDatabase (CadenaConexion); CadenaConexion带来数据 值得一提的是,我正在将Famework2中的一个应用程序迁移到框架4中的一个应用程序 app.config是这样的: <? xml version = "1.0" encoding = "utf-8"?> <configuration> <config

我有一个错误,我在这一行得到的是赋值为空

db = DatabaseFactory.CreateDatabase (CadenaConexion);
CadenaConexion带来数据

值得一提的是,我正在将Famework2中的一个应用程序迁移到框架4中的一个应用程序

app.config是这样的:

    <? xml version = "1.0" encoding = "utf-8"?>
    <configuration>
      <configSections>
        <sectionGroup name = "userSettings" type = "System.Configuration.UserSettingsGroup, System, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089">
          <section name = "Collaboration E.Properties.Settings" type = "System.Configuration.ClientSettingsSection, System, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" allowExeDefinition = "MachineToLocalUser" requirePermission = "false" />
          <section name = "paths" type = "string" />
        </sectionGroup>
      </configSections>
      <connectionStrings>
        <add name = "Inte" connectionString = "Server = DESAOPER; Database = eDocInteDB; User = usr_InteDB; Pwd = G0rd1t @ 5314;" providerName = "System.Data.SqlClient" />
        <add name = "Prod" connectionString = "Server = SRVECOM; Database = eDocProdDB; User = Corporate Dbo; Pwd = Record" providerName = "System.Data.SqlClient" />
      </connectionStrings>
      <appSettings>
        <add key = "Integration" value = "Inte" />
        <add key = "Production" value = "Prod" />
      </appSettings>
      <paths>
        <add key = "File Path" value = "% ROUTE%" />
        <add key = "Delimiter" value = "
    | "/>
        <add key = "URLCSDSAT" value = "ftp://ftp2.sat.gob.mx/agti_service_ftp/verifica_comprobante_ftp/CSD.txt" />
        <add key = "URLFOLSAT" value = "ftp://ftp2.sat.gob.mx/agti_service_ftp/verifica_comprobante_ftp/FoliosCFD.txt" />
      </paths>
      <runtime>
        <assemblyBinding xmlns = "urn: schemas-microsoft-com: asm.v1">
          <dependentAssembly>
            <assemblyIdentity name = "DocumentFormat.OpenXml" publicKeyToken = "8fb06cb64d019a17" culture = "neutral" />
            <bindingRedirect oldVersion = "0.0.0.0-2.10.0.0" newVersion = "2.10.0.0" />
            <! - <assemblyIdentity name = "Microsoft.Practices.ServiceLocation" publicKeyToken = "31bf3856ad364e35" culture = "neutral" />
            <bindingRedirect oldVersion = "0.0.0.0-1.0.0.0" newVersion = "1.0.0.0" /> ->
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <userSettings>
        <Collaboration E.Properties.Settings>
          <setting name = "Password" serializeAs = "String">
            <value />
          </setting>
        </ Collaboration E. Properties.Settings>
      </userSettings>
    </configuration>

->
一切都是c语言的,我对windows窗体没有任何经验


问候和感谢

很可能是您的xml配置有问题。从中删除内容,从空白开始。然后逐个添加部分。你会发现哪一个是问题所在。我可以看出您的
位于
用户设置
之外。这可能是我的错,谢谢这个错误不再出现,它与:“/>”/>有冲突。我评论了这行。我想,你的
路径
只是在
之外。试着把它移到那里。真的应该再次感谢你吗