如何把config中的 configSource 设置到公用的绝对路径,而不只是在项目中的文件,达到公用目的? RRS feed

  • 问题

  • 有多个项目,需要用到相同配置,能否把app.config configSource 的相对路径改成绝对路径,进行配置?
    2018年10月30日 8:51


  • 你好,

    config 中的configSource 是不支持绝对路径的, 如果有多个项目用到相同的配置,我建议写出XML,或者放在数据库中,然后在程序启动的时候读入到一个静态的方法中。

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    2018年10月31日 6:03
  • SHIJIAZHUANG JIPENG IMPORT AND EXPORT CO., LTD. was established in 1998 and is located in SHIJIAZHUANG --the capital of HEBEI province. Our firm is a professional exporter and supplier of home appliance accessories.

    Our firm offers a wide range of products, they are gas pressure regulatorceramic electrode (spark plug)thermocoupleair pressure switchgas valveODS & pilot burner assemblyexhaust pipe, die, piezo igniter3 way valve actuatorhydraulic groupflow sensor3 Bar safety valve, pressure gauge, water pressure switch, water flow switch, sparker, pulse controller, piezo cable, pulse igniter,blade Burner and so on... They are mainly used in gas water heater, gas combined boiler, gas free-standing oven, gas space heater and BBQ grill.

    2018年10月31日 6:50