How to find path of active app.config file?

后端 未结 8 2038
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 04:43

I\'m trying to finish this exception handler:

if (ConfigurationManager.ConnectionStrings[\"ConnectionString\"]==null)
{
    string pathOfActiveConfigFile = .         


        
8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 05:31

    One more option that I saw is missing here:

    const string APP_CONFIG_FILE = "APP_CONFIG_FILE";
    string defaultSysConfigFilePath = (string)AppDomain.CurrentDomain.GetData(APP_CONFIG_FILE);
    

提交回复
热议问题