解决方案 »

  1.   

     ExeConfigurationFileMap fileMap =  new ExeConfigurationFileMap();
     fileMap.ExeConfigFilename = @"D:\tmp\your.exe.config";
     System.Configuration.Configuration config = 
       ConfigurationManager.OpenMappedExeConfiguration(
         fileMap,
         ConfigurationUserLevel.None);
      

  2.   


    我这里搞定了,我就是不想用加载文件,不想更改我的代码,只替换配置文件(下面的链接是正解)
    http://stackoverflow.com/questions/4556071/the-root-element-must-match-the-name-of-the-section-referencing-the-file
      

  3.   


    我这里搞定了,我就是不想用加载文件,不想更改我的代码,只替换配置文件(下面的链接是正解)
    http://stackoverflow.com/questions/4556071/the-root-element-must-match-the-name-of-the-section-referencing-the-file

    Indeed, stackoverflow is a right place to go