How to detect whether the sid-by-side configure file exists?I mean the XML used by System.Configuration.ConfigurationManager.

解决方案 »

  1.   

    什么叫做 side-by-side 的配置文件?
      

  2.   

    不懂英文,要不我还能出出主意
    是不是根据xml 类检测  什么配置文件存在?
      

  3.   

    You can use System.IO.File.Exists() method to detect.
      

  4.   

    If I use System.IO.File.Exists(), I need to get the file name of the configure file myself.
    However, the ConfigurationManager already knows the  configure file. So I think there is a shortcut to do that thing, but I can't find it
      

  5.   

    I have found the answer:
    Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
    config.HasFile